org.enhydra.tool.common
Class FileUtil
java.lang.Object
|
+--org.enhydra.tool.common.FileUtil
- public class FileUtil
- extends java.lang.Object
Method Summary |
static java.io.File |
copy(java.io.File source,
java.io.File dest)
|
static java.io.File |
copy(java.io.InputStream source,
java.io.File dest)
|
static void |
copy(java.io.InputStream source,
java.io.OutputStream dest)
|
static java.io.File |
copy(Template source,
java.io.File dest)
|
static java.io.File |
findFirst(java.io.FileFilter filter,
java.io.File dir,
int count)
|
static java.io.File |
findFirst(java.io.FileFilter filter,
java.lang.String path)
|
static java.lang.String[] |
findJarPaths(java.lang.String jar,
java.lang.ClassLoader loader)
|
static boolean |
isDirectory(java.lang.String path)
|
static boolean |
isFile(java.lang.String path)
|
static java.lang.String |
toCanonicalPath(java.lang.String in)
|
static java.lang.String |
toCurrentPath(java.lang.String path)
|
static java.lang.String |
toJavaPath(java.lang.String in)
|
static java.lang.String |
toShellPath(java.lang.String inPath)
Convert the given path to contain file seperators for
a Unix shell. |
static java.lang.String |
toWindowsPath(java.lang.String path)
Convert the given path to contain file seperators for
Windows. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileUtil
public FileUtil()
copy
public static void copy(java.io.InputStream source,
java.io.OutputStream dest)
throws java.io.IOException
java.io.IOException
copy
public static java.io.File copy(java.io.InputStream source,
java.io.File dest)
throws ToolException
ToolException
copy
public static java.io.File copy(Template source,
java.io.File dest)
throws ToolException
ToolException
copy
public static java.io.File copy(java.io.File source,
java.io.File dest)
throws ToolException
ToolException
isDirectory
public static boolean isDirectory(java.lang.String path)
isFile
public static boolean isFile(java.lang.String path)
toCanonicalPath
public static java.lang.String toCanonicalPath(java.lang.String in)
toJavaPath
public static java.lang.String toJavaPath(java.lang.String in)
toCurrentPath
public static java.lang.String toCurrentPath(java.lang.String path)
toShellPath
public static java.lang.String toShellPath(java.lang.String inPath)
- Convert the given path to contain file seperators for
a Unix shell. This also converts paths that start with a
a Windows drive letter into one compatible with the
Cygnus shell.
- Returns:
- The path compatible with the Cygnus shell.
toWindowsPath
public static java.lang.String toWindowsPath(java.lang.String path)
- Convert the given path to contain file seperators for
Windows. This also converts paths that start with a
'\\' into paths that start with a Windows drive letter.
- Parameters:
path
- File path containing any combination of unix shell and Windows file
seperators.
- Returns:
- The path compatible with the Windows.
findFirst
public static java.io.File findFirst(java.io.FileFilter filter,
java.lang.String path)
findFirst
public static java.io.File findFirst(java.io.FileFilter filter,
java.io.File dir,
int count)
findJarPaths
public static java.lang.String[] findJarPaths(java.lang.String jar,
java.lang.ClassLoader loader)