public final class Files
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
appendLineToFile(java.io.File _file,
java.lang.String _text)
Action that appends some text data to a file.
|
static void |
appendToFile(java.io.File _file,
java.lang.String _text)
Action that appends some text data to a file.
|
static void |
copyFile(java.io.File _srcFile,
java.lang.String _destFilePath)
Action that copies a file from an absolute file path to another
|
static void |
deleteDirectory(java.io.File _dir)
Action that deletes a directory from an absolute file path.
|
static void |
deleteDirectoryRecursive(java.io.File _dir)
Action that deletes a directory tree from an absolute file path.
|
static void |
deleteFile(java.io.File _file)
Action that deletes a file from an absolute file path.
|
static java.lang.String |
getAbsolutePath(java.io.File file)
Returns the absolute path of the file
|
static java.lang.String |
getExtension(java.io.File file)
Returns the extension of the file
|
static java.lang.String |
getName(java.io.File file)
Returns the name of the file
|
static java.io.File |
getParent(java.io.File file)
Returns the parent of the file
|
static void |
moveFile(java.io.File _srcFile,
java.lang.String _destFilePath)
Action that moves a file from an absolute file path to another
|
static void |
tryCopyFile(java.io.File _srcFile,
java.lang.String _destFilePath)
Action that copies a file from an absolute file path to another.
|
static void |
tryDeleteDirectory(java.io.File _dir)
Action that deletes a directory from an absolute file path.
|
static void |
tryDeleteDirectoryRecursive(java.io.File _dir)
Action that deletes a directory tree from an absolute file path.
|
static void |
tryDeleteFile(java.io.File _file)
Action that deletes a file from an absolute file path.
|
static void |
tryMoveFile(java.io.File _srcFile,
java.lang.String _destFilePath)
Action that moves a file from one absolute file path to another.
|
public static void appendToFile(java.io.File _file, java.lang.String _text)
java.lang.NullPointerException
- An argument is nulljava.lang.IllegalArgumentException
- An argument is out of rangeIOException
- An I/O error occursFileNotFoundException
- The file specified is a directory, or it does not exist and cannot be created, or cannot be appended to.java.lang.SecurityException
- Access to filesystem is denied by a SecurityManagerpublic static void appendLineToFile(java.io.File _file, java.lang.String _text)
java.lang.NullPointerException
- An argument is nulljava.lang.IllegalArgumentException
- An argument is out of rangeIOException
- An I/O error occursFileNotFoundException
- The file specified is a directory, or it does not exist and cannot be created, or cannot be appended to.java.lang.SecurityException
- Access to filesystem is denied by a SecurityManagerpublic static void copyFile(java.io.File _srcFile, java.lang.String _destFilePath)
java.lang.NullPointerException
- An argument is nullIOException
- An I/O error occursFileNotFoundException
- The file specified is a directory, it does not exist or cannot be read/created.java.lang.SecurityException
- Access to filesystem is denied by a SecurityManagerpublic static void deleteFile(java.io.File _file)
java.lang.NullPointerException
- An argument is nullIOException
- An I/O error occursFileNotFoundException
- The file was a directoryjava.lang.SecurityException
- Access to filesystem is denied by a SecurityManagerpublic static void deleteDirectory(java.io.File _dir)
java.lang.NullPointerException
- An argument is nullIOException
- An I/O error occursFileNotFoundException
- The file was not a directoryjava.lang.SecurityException
- Access to filesystem is denied by a SecurityManagerpublic static void deleteDirectoryRecursive(java.io.File _dir)
java.lang.NullPointerException
- An argument is nullIOException
- An I/O error occursFileNotFoundException
- The file was not a directoryjava.lang.SecurityException
- Access to filesystem is denied by a SecurityManagerpublic static java.lang.String getAbsolutePath(java.io.File file)
java.lang.NullPointerException
- An argument is nulljava.lang.SecurityException
- If a required system property value cannot be accessedpublic static java.lang.String getExtension(java.io.File file)
java.lang.NullPointerException
- An argument is nullpublic static java.lang.String getName(java.io.File file)
java.lang.NullPointerException
- An argument is nullpublic static java.io.File getParent(java.io.File file)
java.lang.NullPointerException
- An argument is nulljava.lang.SecurityException
- If a required system property value cannot be accessedpublic static void moveFile(java.io.File _srcFile, java.lang.String _destFilePath)
java.lang.NullPointerException
- An argument is nullIOException
- An I/O error occursFileNotFoundException
- The file specified is a directory, it does not exist or cannot be read/created.java.lang.SecurityException
- Access to filesystem is denied by a SecurityManagerpublic static void tryCopyFile(java.io.File _srcFile, java.lang.String _destFilePath)
public static void tryDeleteFile(java.io.File _file)
public static void tryDeleteDirectory(java.io.File _dir)
public static void tryDeleteDirectoryRecursive(java.io.File _dir)
public static void tryMoveFile(java.io.File _srcFile, java.lang.String _destFilePath)