|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ivy.util.FileUtil
public final class FileUtil
Utility class used to deal with file related operations, like copy, full reading, symlink, ...
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.File src,
java.net.URL dest,
CopyProgressListener l)
|
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.io.InputStream src,
java.io.OutputStream dest,
CopyProgressListener l,
boolean autoClose)
|
static void |
copy(java.net.URL src,
java.io.File dest,
CopyProgressListener l)
|
static boolean |
forceDelete(java.io.File file)
Recursively delete file |
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,
java.util.Collection ignore)
Returns a collection of all Files being contained in the given directory, recursively, including directories. |
static java.io.File |
normalize(java.lang.String path)
"Normalize" the given absolute path. |
static java.lang.String |
readEntirely(java.io.BufferedReader in)
Reads the whole BufferedReader line by line, using \n as line separator for each line. |
static java.lang.String |
readEntirely(java.io.File f)
Reads the entire content of the file and returns it as a String. |
static java.lang.String |
readEntirely(java.io.InputStream is)
Reads the entire content of the InputStream and returns it as a String. |
static java.io.File |
resolveFile(java.io.File file,
java.lang.String filename)
|
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 |
Method Detail |
---|
public static void symlink(java.io.File src, java.io.File dest, CopyProgressListener l, boolean overwrite) throws java.io.IOException
java.io.IOException
public static boolean copy(java.io.File src, java.io.File dest, CopyProgressListener l) throws java.io.IOException
java.io.IOException
public static boolean copy(java.io.File src, java.io.File dest, CopyProgressListener l, boolean overwrite) throws java.io.IOException
java.io.IOException
public static void copy(java.net.URL src, java.io.File dest, CopyProgressListener l) throws java.io.IOException
java.io.IOException
public static void copy(java.io.File src, java.net.URL dest, CopyProgressListener l) throws java.io.IOException
java.io.IOException
public static void copy(java.io.InputStream src, java.io.File dest, CopyProgressListener l) throws java.io.IOException
java.io.IOException
public static void copy(java.io.InputStream src, java.io.OutputStream dest, CopyProgressListener l) throws java.io.IOException
java.io.IOException
public static void copy(java.io.InputStream src, java.io.OutputStream dest, CopyProgressListener l, boolean autoClose) throws java.io.IOException
java.io.IOException
public static java.lang.String readEntirely(java.io.BufferedReader in) throws java.io.IOException
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.
in
- the BufferedReader
to read from
BufferedReader
java.io.IOException
- if an IO problems occur during readingpublic static java.lang.String readEntirely(java.io.File f) throws java.io.IOException
f
- the file to read from
java.io.IOException
- if an IO problems occurs during readingpublic static java.lang.String readEntirely(java.io.InputStream is) throws java.io.IOException
InputStream
and returns it as a String.
The input stream is closed when this method returns.
is
- the InputStream
to read from
java.io.IOException
- if an IO problems occurs during readingpublic static java.lang.String concat(java.lang.String dir, java.lang.String file)
public static boolean forceDelete(java.io.File file)
file
- the file to delete
public static java.util.List getPathFiles(java.io.File root, java.io.File file)
public static java.util.Collection listAll(java.io.File dir, java.util.Collection ignore)
dir
- The directory from which all files, including files in subdirectory)
are extracted.ignore
- a Collection of filenames which must be excluded from listing
public static java.io.File resolveFile(java.io.File file, java.lang.String filename)
public static java.io.File normalize(java.lang.String path)
This includes:
File.getCanonicalPath()
this method
specifically does not resolve symbolic links.
path
- the path to be normalized.
java.lang.NullPointerException
- if path is null.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |