org.apache.ivy.util
public final class FileUtil extends Object
Method Summary | |
---|---|
static String | concat(String dir, String file) |
static boolean | copy(File src, File dest, CopyProgressListener l) |
static boolean | copy(File src, File dest, CopyProgressListener l, boolean overwrite) |
static void | copy(URL src, File dest, CopyProgressListener l) |
static void | copy(File src, URL dest, CopyProgressListener l) |
static void | copy(InputStream src, File dest, CopyProgressListener l) |
static void | copy(InputStream src, OutputStream dest, CopyProgressListener l) |
static boolean | forceDelete(File file)
Recursively delete file
|
static List | getPathFiles(File root, File file)
Returns a list of Files composed of all directories being parent of file and child of root +
file and root themselves. |
static Collection | listAll(File dir, Collection ignore)
Returns a collection of all Files being contained in the given directory, recursively,
including directories.
|
static String | readEntirely(BufferedReader in)
Reads the whole BufferedReader line by line, using \n as line separator for each line.
|
static String | readEntirely(File f)
Reads the entire content of the file and returns it as a String.
|
static String | readEntirely(InputStream is)
Reads the entire content of the InputStream and returns it as a String.
|
static File | resolveFile(File file, String filename) |
static void | symlink(File src, File dest, CopyProgressListener l, boolean overwrite) |
Parameters: file the file to delete
Returns: true if the deletion completed successfully (ie if the file does not exist on the filesystem after this call), false if a deletion was not performed successfully.
Parameters: dir The directory from which all files, including files in subdirectory) are extracted. ignore a Collection of filenames which must be excluded from listing
Returns: A collectoin containing all the files of the given directory and it's subdirectories.
Note that this method will add a final \n to the last line even though there is no new line character at the end of last line in the original reader.
The BufferedReader is closed when this method returns.
Parameters: in the BufferedReader to read from
Returns: a String with the whole content read from the BufferedReader
Throws: IOException if an IO problems occur during reading
Parameters: f the file to read from
Returns: a String with the file content
Throws: IOException if an IO problems occurs during reading
The input stream is closed when this method returns.
Parameters: is the InputStream to read from
Returns: a String with the input stream content
Throws: IOException if an IO problems occurs during reading