|
Apache Tomcat 7.0.42 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tomcat.util.http.fileupload.FileUtils
public class FileUtils
General file manipulation utilities.
Facilities are provided in the following areas:
Origin of code: Excalibur, Alexandria, Commons-Utils
Constructor Summary | |
---|---|
FileUtils()
Instances should NOT be constructed in standard programming. |
Method Summary | |
---|---|
static void |
cleanDirectory(File directory)
Cleans a directory without deleting it. |
static void |
deleteDirectory(File directory)
Deletes a directory recursively. |
static void |
forceDelete(File file)
Deletes a file. |
static void |
forceDeleteOnExit(File file)
Schedules a file to be deleted when JVM exits. |
static boolean |
isSymlink(File file)
Determines whether the specified file is a Symbolic Link rather than an actual file. |
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 deleteDirectory(File directory) throws IOException
directory
- directory to delete
IOException
- in case deletion is unsuccessfulpublic static void cleanDirectory(File directory) throws IOException
directory
- directory to clean
IOException
- in case cleaning is unsuccessfulpublic static void forceDelete(File file) throws IOException
The difference between File.delete() and this method are:
file
- file or directory to delete, must not be null
NullPointerException
- if the directory is null
FileNotFoundException
- if the file was not found
IOException
- in case deletion is unsuccessfulpublic static void forceDeleteOnExit(File file) throws IOException
file
- file or directory to delete, must not be null
NullPointerException
- if the file is null
IOException
- in case deletion is unsuccessfulpublic static boolean isSymlink(File file) throws IOException
Will not return true if there is a Symbolic Link anywhere in the path, only if the specific file is.
Note: the current implementation always returns false
if
the system is detected as Windows using
File.separatorChar
== '\\'
file
- the file to check
IOException
- if an IO error occurs while checking the file
|
Apache Tomcat 7.0.42 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |