FileUtils
- public class FileUtils
Fields
chownScript
Methods
createFolders
createSymlink
delete
delete
- public static Undoable delete(File file, boolean recursive)
Delete a file undoable. If file is a directory and ‘recursive’ is true the directory and all of its sub folders are deleted. If file is a directory and ‘recursive’ is false file is deleted unless it has sub folders. If file is an actual file (and not a directory) the file is deleted. Otherwise, nothing happens.
- Parameters:
file –
recursive –
- Throws:
getChecksum
- public static String getChecksum(File file)
Get the HEXed SHA-512 checksum of a file or a folder. The Checksum C of a folder f is calculated by (recursively): C(f) = C(C(f_name) + C(f_subfile_1) + … + C(f_subfile_N)) while f_name is the (String) name of f and f_subfile_1 to f_subfile_N are the alphabetically ordered subfiles and subfolders of f. The alphabetical order is defined by UTF16.
- Parameters:
file –
- Returns:
SHA-512 Checksum
getMimeType
getSize
isSubDirSymlinkSave
- public static boolean isSubDirSymlinkSave(File file, File root)
Return true iff file is not a simlink to a directory and root is not a simlink.
Symlinks are not allowed for the root. Symlinks are allowed only for a File object if it is a file symlink, not a directory symlink.
- Parameters:
file –
root –
- Throws:
RuntimeException,
– if subdir is symlink on a directory or if the root is a simlink.
isSymlink
isSymlinkPointingTo
rename
runChownScript
testChownScript
- public static void testChownScript()
- Throws: