org.apache.ivy.util
Class FileUtil
java.lang.Object
org.apache.ivy.util.FileUtil
public class FileUtil
- extends java.lang.Object
- Author:
- x.hanin
Method Summary |
static java.lang.String |
concat(java.lang.String dir,
java.lang.String file)
|
static boolean |
copy(java.io.File src,
java.io.File dest,
CopyProgressListener l)
|
static boolean |
copy(java.io.File src,
java.io.File dest,
CopyProgressListener l,
boolean overwrite)
|
static void |
copy(java.io.InputStream src,
java.io.File dest,
CopyProgressListener l)
|
static void |
copy(java.io.InputStream src,
java.io.OutputStream dest,
CopyProgressListener l)
|
static void |
copy(java.net.URL src,
java.io.File dest,
CopyProgressListener l)
|
static void |
forceDelete(java.io.File f)
|
static java.util.List |
getPathFiles(java.io.File root,
java.io.File file)
Returns a list of Files composed of all directories being
parent of file and child of root + file and root themselves. |
static java.util.Collection |
listAll(java.io.File dir)
Returns a collection of all Files being contained in the given directory,
recursively, including directories. |
static java.lang.String |
readEntirely(java.io.BufferedReader in)
|
static void |
symlink(java.io.File src,
java.io.File dest,
CopyProgressListener l,
boolean overwrite)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileUtil
public FileUtil()
symlink
public static void symlink(java.io.File src,
java.io.File dest,
CopyProgressListener l,
boolean overwrite)
throws java.io.IOException
- Throws:
java.io.IOException
copy
public static boolean copy(java.io.File src,
java.io.File dest,
CopyProgressListener l)
throws java.io.IOException
- Throws:
java.io.IOException
copy
public static boolean copy(java.io.File src,
java.io.File dest,
CopyProgressListener l,
boolean overwrite)
throws java.io.IOException
- Throws:
java.io.IOException
copy
public static void copy(java.net.URL src,
java.io.File dest,
CopyProgressListener l)
throws java.io.IOException
- Throws:
java.io.IOException
copy
public static void copy(java.io.InputStream src,
java.io.File dest,
CopyProgressListener l)
throws java.io.IOException
- Throws:
java.io.IOException
copy
public static void copy(java.io.InputStream src,
java.io.OutputStream dest,
CopyProgressListener l)
throws java.io.IOException
- Throws:
java.io.IOException
readEntirely
public static java.lang.String readEntirely(java.io.BufferedReader in)
throws java.io.IOException
- Throws:
java.io.IOException
concat
public static java.lang.String concat(java.lang.String dir,
java.lang.String file)
forceDelete
public static void forceDelete(java.io.File f)
getPathFiles
public static java.util.List getPathFiles(java.io.File root,
java.io.File file)
- Returns a list of Files composed of all directories being
parent of file and child of root + file and root themselves.
Example:
getPathFiles(new File("test"), new File("test/dir1/dir2/file.txt"))
=> {new File("test/dir1"), new File("test/dir1/dir2"), new File("test/dir1/dir2/file.txt") }
Note that if root is not an ancester of file, or if root is null, all directories from the
file system root will be returned.
listAll
public static java.util.Collection listAll(java.io.File dir)
- Returns a collection of all Files being contained in the given directory,
recursively, including directories.
- Parameters:
dir
-
- Returns: