|
02/28/2005 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.vignette.portal.util.FileUtils
File management utilities.
| Constructor Summary | |
FileUtils()
|
|
| Method Summary | |
static String |
appendSlash(String dir)
Add a trailing slash (File.separator) on given string to make it a directory. |
static void |
copy(File source,
File destination)
Copy the source file or directory to the destination. |
static boolean |
delete(File file)
Delete the given file or directory, recursively. |
static boolean |
deleteDirectoryContents(File file)
Delete the files and subdirectories of the given directory, recursively. |
static String |
fixSlashes(String str)
Change any forward or backward slashes into the File.separator. |
static String |
generateUniqueName()
Generate a file name that's unique through all calls to this method (assuming nobody tampers with the clock). |
static URL |
toFileURL(String file_path)
Get the file URL version of the specified local file path. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FileUtils()
| Method Detail |
public static void copy(File source,
File destination)
source - The file to be copied.destination - The file to which source will be copied.public static boolean delete(File file)
file - The file to be deleted.true if the specified file was deleted successfully.public static boolean deleteDirectoryContents(File file)
file - The directory in which to delete all contents.true if the operation was successful.public static URL toFileURL(String file_path)
file_path
is null or an empty string. Also returns null if the given file_path cannot generate
a well formed URL.file_path - The file path of a local file on the file system.public static String generateUniqueName()
public static String fixSlashes(String str)
str - The string on which to fix slashes.str but with all forward or backward slashes replaced with File.separator.public static String appendSlash(String dir)
dir - The directory string on which to append a File.seperator if required.dir.
|
02/28/2005 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||