Package io.deephaven.util.files
Class FileHelper
java.lang.Object
io.deephaven.util.files.FileHelper
Utility/helper methods for file operations.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Give callers ofdeleteRecursivelyOnNFS(File, Pattern)
a better exception to catch. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
deleteRecursivelyOnNFS
(File trashFile, File fileToBeDeleted, @Nullable Pattern excludePattern) AugmentFileUtils.deleteRecursivelyOnNFS(File, File)
with an exclude pattern.static boolean
deleteRecursivelyOnNFS
(File file, String excludePattern) AugmentFileUtils.deleteRecursivelyOnNFS(File)
with an exclude pattern.static boolean
deleteRecursivelyOnNFS
(File file, Pattern excludePattern) AugmentFileUtils.deleteRecursivelyOnNFS(File)
with an exclude pattern.static String
getCanonicalForm
(String path) Get the canonical path for the given path string, converting IOExceptions to UncheckIOException.
-
Method Details
-
getCanonicalForm
Get the canonical path for the given path string, converting IOExceptions to UncheckIOException.- Parameters:
path
- The file (as String) for which to get the canonical form.- Returns:
- the canonical file string.
-
deleteRecursivelyOnNFS
AugmentFileUtils.deleteRecursivelyOnNFS(File)
with an exclude pattern. Files matching the pattern will not be removed, nor will containing directories.- Parameters:
file
- the file or folder to delete.excludePattern
- don't delete files or folders matching this pattern.- Returns:
- true if any files were excluded (so caller will know if a directory is empty)
- Throws:
FileHelper.FileDeletionException
- on any errors moving/renaming/deleting files
-
deleteRecursivelyOnNFS
AugmentFileUtils.deleteRecursivelyOnNFS(File)
with an exclude pattern. Files matching the pattern will not be removed, nor will containing directories.- Parameters:
file
- the file or folder to delete.excludePattern
- don't delete files or folders matching this pattern.- Returns:
- true if any files were excluded (so caller will know if a directory is empty)
- Throws:
FileHelper.FileDeletionException
- on any errors moving/renaming/deleting files
-
deleteRecursivelyOnNFS
public static boolean deleteRecursivelyOnNFS(File trashFile, File fileToBeDeleted, @Nullable @Nullable Pattern excludePattern) AugmentFileUtils.deleteRecursivelyOnNFS(File, File)
with an exclude pattern. Files matching the pattern will not be removed, nor will containing directories.This is an implementation method for
deleteRecursivelyOnNFS(File, String)
- Parameters:
trashFile
- Filename to move regular files to before deletion. .nfs files may be created in its parent directory.fileToBeDeleted
- File or directory at which to begin recursive deletion.excludePattern
- don't delete files or folders matching this pattern.- Returns:
- true if any files were excluded (so caller will know if a directory is empty)
- Throws:
FileHelper.FileDeletionException
- on any errors moving/renaming/deleting files
-