@ThreadSafe public final class PathOperations extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_EXCEPTION_ON_DELETE_ROOT
The default value for warning if we're about to delete the root directory.
|
| Modifier and Type | Method and Description |
|---|---|
static FileIOError |
copyDirRecursive(Path aSourceDir,
Path aTargetDir)
Copy a directory including all child objects.
|
static FileIOError |
copyFile(Path aSourceFile,
Path aTargetFile)
Copies the source file to the target file.
|
static FileIOError |
createDir(Path aDir)
Create a new directory.
|
static FileIOError |
createDirIfNotExisting(Path aDir)
Create a new directory if it does not exist.
|
static FileIOError |
createDirRecursive(Path aDir)
Create a new directory.
|
static FileIOError |
createDirRecursiveIfNotExisting(Path aDir)
Create a new directory if it does not exist.
|
static FileIOError |
deleteDir(Path aDir)
Delete an existing directory.
|
static FileIOError |
deleteDirIfExisting(Path aDir)
Delete an existing directory if it is existing.
|
static FileIOError |
deleteDirRecursive(Path aDir)
Delete an existing directory including all child objects.
|
static FileIOError |
deleteDirRecursiveIfExisting(Path aDir)
Delete an existing directory including all child objects if it is existing.
|
static FileIOError |
deleteFile(Path aFile)
Delete an existing file.
|
static FileIOError |
deleteFileIfExisting(Path aFile)
Delete a file if it is existing.
|
static boolean |
isExceptionOnDeleteRoot() |
static FileIOError |
renameDir(Path aSourceDir,
Path aTargetDir)
Rename a directory.
|
static FileIOError |
renameFile(Path aSourceFile,
Path aTargetFile)
Rename a file.
|
static void |
setExceptionOnDeleteRoot(boolean bExceptionOnDeleteRoot) |
public static final boolean DEFAULT_EXCEPTION_ON_DELETE_ROOT
public static boolean isExceptionOnDeleteRoot()
public static void setExceptionOnDeleteRoot(boolean bExceptionOnDeleteRoot)
@Nonnull public static FileIOError createDir(@Nonnull Path aDir)
aDir - The directory to be created. May not be null.null error code.@Nonnull public static FileIOError createDirIfNotExisting(@Nonnull Path aDir)
aDir - The directory to be created if it does not exist. May not be
null.null error code.@Nonnull public static FileIOError createDirRecursive(@Nonnull Path aDir)
aDir - The directory to be created. May not be null.null error code.@Nonnull public static FileIOError createDirRecursiveIfNotExisting(@Nonnull Path aDir)
aDir - The directory to be created if it does not exist. May not be
null.null error code.createDirRecursive(Path)@Nonnull public static FileIOError deleteDir(@Nonnull Path aDir)
aDir - The directory to be deleted. May not be null.null error code.@Nonnull public static FileIOError deleteDirIfExisting(@Nonnull Path aDir)
aDir - The directory to be deleted. May not be null.null error code.deleteDir(Path)@Nonnull public static FileIOError deleteDirRecursive(@Nonnull Path aDir)
aDir - The directory to be deleted. May not be null.null error code.@Nonnull public static FileIOError deleteDirRecursiveIfExisting(@Nonnull Path aDir)
aDir - The directory to be deleted. May not be null.null error code.@Nonnull public static FileIOError deleteFile(@Nonnull Path aFile)
aFile - The file to be deleted. May not be null.null error code.@Nonnull public static FileIOError deleteFileIfExisting(@Nonnull Path aFile)
aFile - The file to be deleted. May not be null.null error code.@Nonnull public static FileIOError renameFile(@Nonnull Path aSourceFile, @Nonnull Path aTargetFile)
aSourceFile - The original file name. May not be null.aTargetFile - The destination file name. May not be null.null error code.@Nonnull public static FileIOError renameDir(@Nonnull Path aSourceDir, @Nonnull Path aTargetDir)
aSourceDir - The original directory name. May not be null.aTargetDir - The destination directory name. May not be null.null error code.@Nonnull public static FileIOError copyFile(@Nonnull Path aSourceFile, @Nonnull Path aTargetFile)
aSourceFile - The source file to use. May not be null. Needs to be an
existing file.aTargetFile - The destination files. May not be null and may not be
an existing file.null error code.@Nonnull public static FileIOError copyDirRecursive(@Nonnull Path aSourceDir, @Nonnull Path aTargetDir)
aSourceDir - The source directory to be copied. May not be null.aTargetDir - The destination directory where to be copied. This directory may not
be existing. May not be null.null error code.Copyright © 2014–2022 Philip Helger. All rights reserved.