@NotThreadSafe public class FileOperationManager extends Object implements IFileOperationManager
| Modifier and Type | Field and Description |
|---|---|
static IFileOperationManager |
INSTANCE |
| Constructor and Description |
|---|
FileOperationManager() |
| Modifier and Type | Method and Description |
|---|---|
CallbackList<IFileOperationCallback> |
callbacks() |
FileIOError |
copyDirRecursive(File aSourceDir,
File aTargetDir)
Copy a directory including all child objects.
|
FileIOError |
copyFile(File aSourceFile,
File aTargetFile)
Copies the source file to the target file.
|
FileIOError |
createDir(File aDir)
Create a new directory.
|
FileIOError |
createDirIfNotExisting(File aDir)
Create a new directory if it does not exist.
|
FileIOError |
createDirRecursive(File aDir)
Create a new directory.
|
FileIOError |
createDirRecursiveIfNotExisting(File aDir)
Create a new directory if it does not exist.
|
FileIOError |
deleteDir(File aDir)
Delete an existing directory.
|
FileIOError |
deleteDirIfExisting(File aDir)
Delete an existing directory if it is existing.
|
FileIOError |
deleteDirRecursive(File aDir)
Delete an existing directory including all child objects.
|
FileIOError |
deleteDirRecursiveIfExisting(File aDir)
Delete an existing directory including all child objects if it is existing.
|
FileIOError |
deleteFile(File aFile)
Delete an existing file.
|
FileIOError |
deleteFileIfExisting(File aFile)
Delete a file if it is existing.
|
FileIOError |
getLastError() |
EFileIOOperation |
getLastOperation() |
FileIOError |
renameDir(File aSourceDir,
File aTargetDir)
Rename a directory.
|
FileIOError |
renameFile(File aSourceFile,
File aTargetFile)
Rename a file.
|
String |
toString() |
public static final IFileOperationManager INSTANCE
@Nonnull @ReturnsMutableObject public CallbackList<IFileOperationCallback> callbacks()
@Nullable public FileIOError getLastError()
getLastError in interface IFileOperationManagernull if no action
was yet performed.@Nullable public EFileIOOperation getLastOperation()
getLastOperation in interface IFileOperationManagernull if no action was performed yet.@Nonnull public FileIOError createDir(@Nonnull File aDir)
IFileOperationManagercreateDir in interface IFileOperationManageraDir - The directory to be created. May not be null.null error code.@Nonnull public FileIOError createDirIfNotExisting(@Nonnull File aDir)
IFileOperationManagercreateDirIfNotExisting in interface IFileOperationManageraDir - The directory to be created if it does not exist. May not be
null.null error code.@Nonnull public FileIOError createDirRecursive(@Nonnull File aDir)
IFileOperationManagercreateDirRecursive in interface IFileOperationManageraDir - The directory to be created. May not be null.null error code.@Nonnull public FileIOError createDirRecursiveIfNotExisting(@Nonnull File aDir)
IFileOperationManagercreateDirRecursiveIfNotExisting in interface IFileOperationManageraDir - The directory to be created if it does not exist. May not be
null.null error code.@Nonnull public FileIOError deleteDir(@Nonnull File aDir)
IFileOperationManagerdeleteDir in interface IFileOperationManageraDir - The directory to be deleted. May not be null.null error code.@Nonnull public FileIOError deleteDirIfExisting(@Nonnull File aDir)
IFileOperationManagerdeleteDirIfExisting in interface IFileOperationManageraDir - The directory to be deleted. May not be null.null error code.@Nonnull public FileIOError deleteDirRecursive(@Nonnull File aDir)
IFileOperationManagerdeleteDirRecursive in interface IFileOperationManageraDir - The directory to be deleted. May not be null.null error code.@Nonnull public FileIOError deleteDirRecursiveIfExisting(@Nonnull File aDir)
IFileOperationManagerdeleteDirRecursiveIfExisting in interface IFileOperationManageraDir - The directory to be deleted. May not be null.null error code.@Nonnull public FileIOError deleteFile(@Nonnull File aFile)
IFileOperationManagerdeleteFile in interface IFileOperationManageraFile - The file to be deleted. May not be null.null error code.@Nonnull public FileIOError deleteFileIfExisting(@Nonnull File aFile)
IFileOperationManagerdeleteFileIfExisting in interface IFileOperationManageraFile - The file to be deleted. May not be null.null error code.@Nonnull public FileIOError renameDir(@Nonnull File aSourceDir, @Nonnull File aTargetDir)
IFileOperationManagerrenameDir in interface IFileOperationManageraSourceDir - The original directory name. May not be null.aTargetDir - The destination directory name. May not be null.null error code.@Nonnull public FileIOError renameFile(@Nonnull File aSourceFile, @Nonnull File aTargetFile)
IFileOperationManagerrenameFile in interface IFileOperationManageraSourceFile - The original file name. May not be null.aTargetFile - The destination file name. May not be null.null error code.@Nonnull public FileIOError copyDirRecursive(@Nonnull File aSourceDir, @Nonnull File aTargetDir)
IFileOperationManagercopyDirRecursive in interface IFileOperationManageraSourceDir - 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.@Nonnull public FileIOError copyFile(@Nonnull File aSourceFile, @Nonnull File aTargetFile)
IFileOperationManagercopyFile in interface IFileOperationManageraSourceFile - 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.Copyright © 2014–2017 Philip Helger. All rights reserved.