public final class FileUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
createNewFile(java.io.File file)
Creates a new, empty file.
|
static void |
createNewFile(java.io.File file,
boolean overwrite)
Creates a new, empty file.
|
static void |
delete(java.io.File file)
Deletes a specific file.
|
static void |
deleteRecursively(java.io.File file)
Deletes a specific file or directory.
|
static void |
mkdir(java.io.File directory)
Creates a specific directory, if it does not already exist.
|
static void |
mkdirs(java.io.File directory)
Creates a specific directory, if it does not already exist.
|
public static void mkdir(java.io.File directory)
throws java.io.IOException
mkdirs-method instead.directory - The directory, which should be created, as an instance of the class File. The
directory may not be nulljava.io.IOException - The exception, which is thrown, if an error occurred while creating the directorypublic static void mkdirs(java.io.File directory)
throws java.io.IOException
mkdir-method instead.directory - The directory, which should be created, as an instance of the class File. The
directory may not be nulljava.io.IOException - The exception, which is thrown, if an error occurred while creating the directorypublic static void delete(java.io.File file)
throws java.io.IOException
deleteRecursively-method instead.file - The file, which should be deleted, as an instance of the class File. The file
may not be nulljava.io.IOException - The exception, which is thrown, if an error occurred while deleting the filepublic static void deleteRecursively(java.io.File file)
throws java.io.IOException
file - The file or directory, which should be deleted, as an instance of the class File. The file or directory may not be nulljava.io.IOException - The exception, which is thrown, if an error occurs while deleting the file or
directorypublic static void createNewFile(java.io.File file)
throws java.io.IOException
file - The file, which should be created, as an instance of the class File. The file
may not be null. If the file is a directory, an IllegalArgumentException will
be thrownjava.io.IOException - The exception, which is thrown, if an error occurs while creating the filepublic static void createNewFile(java.io.File file,
boolean overwrite)
throws java.io.IOException
file - The file, which should be created, as an instance of the class File. The file
may not be null. If the file is a directory, an IllegalArgumentException will
be thrownoverwrite - True, if the file should be overwritten, if it does already exist, false otherwisejava.io.IOException - The exception, which is thrown, if an error occurs while creating the file