| java.lang.Object | |
| ↳ | casmi.util.FileUtil |
File utility class.
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| PATH_SEPARATOR | The system-dependent path-separator character. | ||||||||||
| SEPARATOR | The system-dependent default name-separator character, represented as a string for convenience. | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Copies a file to a new location preserving the file date.
| |||||||||||
Deletes a file.
| |||||||||||
Check file existence
| |||||||||||
Returns a suffix string from a File.
| |||||||||||
Moves a file from src to dest.
| |||||||||||
Search an absolute file path from current working directory recursively.
| |||||||||||
Implements the same behavior as the "touch" utility on Unix.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
The system-dependent path-separator character. This field is initialized to contain the first character of the value of the system property path.separator. This character is used to separate filenames in a sequence of files given as a path list. On UNIX systems, this character is ':'; on Microsoft Windows systems it is ';'.
The system-dependent default name-separator character, represented as a string for convenience. This string contains a single character. This field is initialized to contain the first character of the value of the system property file.separator. On UNIX systems the value of this field is '/'; on Microsoft Windows systems it is '\\'.
Copies a file to a new location preserving the file date.
| src | An existing file to copy, must not be null. |
|---|---|
| dest | The new file, must not be null and exist. |
| IOException | If copying is failed. |
|---|
Deletes a file.
| file | A file to delete. |
|---|
true if the file was deleted, otherwise
false.
Check file existence
true if the file is exist, otherwise return false
Returns a suffix string from a File.
| file | The file to know the suffix. |
|---|
Moves a file from src to dest. This method is equals to "copy -> delete."
| src | An existing file to move, must not be null. |
|---|---|
| dest | The destination file, must not be null and exist. |
| IOException | If moving is failed. |
|---|
Search an absolute file path from current working directory recursively.
| fileName | file name to search. |
|---|
Implements the same behavior as the "touch" utility on Unix. It creates a new file with size 0 byte or, if the file exists already, it is opened and closed without modifying it, but updating the file date and time.
| file | The file to "touch." |
|---|
| FileNotFoundException | If the file is not found. |
|---|