|
||||||||||
| PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.util.file.Files
A collection of file utilities.
| Field Summary | |
static int |
DEFAULT_BUFFER_SIZE
The default size of the copy buffer. |
| Constructor Summary | |
Files()
|
|
| Method Summary | |
static void |
copy(java.io.File source,
java.io.File target)
Copy a file. |
static void |
copy(java.io.File source,
java.io.File target,
byte[] buff)
Copy a file. |
static void |
copy(java.io.File source,
java.io.File target,
int size)
Copy a file. |
static void |
copy(java.net.URL src,
java.io.File dest)
Copy a remote/local URL to a local file |
static java.lang.String |
decodeFileName(java.lang.String name)
Used to decode a file system friendly filename produced by encodeFileName() method, above. |
static boolean |
delete(java.io.File dir)
Delete a file, or a directory and all of its contents. |
static boolean |
delete(java.lang.String dirname)
Delete a file or directory and all of its contents. |
static boolean |
deleteContaining(java.lang.String filename)
Delete a directory contaning the given file and all its contents. |
static java.lang.String |
encodeFileName(java.lang.String name)
Used to encode any string into a string that is safe to use as a file name on most operating systems. |
static java.lang.String |
findRelativePath(java.lang.String base,
java.lang.String path)
Build a relative path to the given base path. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int DEFAULT_BUFFER_SIZE
| Constructor Detail |
public Files()
| Method Detail |
public static boolean delete(java.io.File dir)
dir - The directory or file to delete.
public static boolean delete(java.lang.String dirname)
dirname - The name of the file or directory to delete.
public static boolean deleteContaining(java.lang.String filename)
filename - a file or directory in the containing directory to delete
public static void copy(java.io.File source,
java.io.File target,
byte[] buff)
throws java.io.IOException
source - Source file to copy.target - Destination target file.buff - The copy buffer.
java.io.IOException - Failed to copy file.
public static void copy(java.io.File source,
java.io.File target,
int size)
throws java.io.IOException
source - Source file to copy.target - Destination target file.size - The size of the copy buffer.
java.io.IOException - Failed to copy file.
public static void copy(java.io.File source,
java.io.File target)
throws java.io.IOException
source - Source file to copy.target - Destination target file.
java.io.IOException - Failed to copy file.
public static void copy(java.net.URL src,
java.io.File dest)
throws java.io.IOException
src - the remote or local URLdest - the local file
java.io.IOException - upon errorpublic static java.lang.String encodeFileName(java.lang.String name)
name - the filename to encode
public static java.lang.String decodeFileName(java.lang.String name)
name - the filename to decode
public static java.lang.String findRelativePath(java.lang.String base,
java.lang.String path)
throws java.io.IOException
base - - the path used as the basepath - - the path to compute relative to the base path
java.io.IOException
|
||||||||||
| PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||