Package com.helger.commons.io.file
Interface IFileOperationManager
- All Known Implementing Classes:
FileOperationManager
public interface IFileOperationManager
Interface for a manager operating on the file system. Is implemented by
FileOperationManager.- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptioncopyDirRecursive(File aSourceDir, File aTargetDir) Copy a directory including all child objects.Copies the source file to the target file.Create a new directory.createDirIfNotExisting(File aDir) Create a new directory if it does not exist.createDirRecursive(File aDir) Create a new directory.Create a new directory if it does not exist.Delete an existing directory.deleteDirIfExisting(File aDir) Delete an existing directory if it is existing.deleteDirRecursive(File aDir) Delete an existing directory including all child objects.Delete an existing directory including all child objects if it is existing.deleteFile(File aFile) Delete an existing file.deleteFileIfExisting(File aFile) Delete a file if it is existing.Rename a directory.renameFile(File aSourceFile, File aTargetFile) Rename a file.
-
Method Details
-
getLastError
- Returns:
- The last error that occurred. May be
nullif no action was yet performed.
-
getLastOperation
- Returns:
- The last operation that was executed, independent of error or
success. May be
nullif no action was performed yet.
-
createDir
Create a new directory. The direct parent directory already needs to exist.- Parameters:
aDir- The directory to be created. May not benull.- Returns:
- A non-
nullerror code.
-
createDirIfNotExisting
Create a new directory if it does not exist. The direct parent directory already needs to exist.- Parameters:
aDir- The directory to be created if it does not exist. May not benull.- Returns:
- A non-
nullerror code.
-
createDirRecursive
Create a new directory. The parent directories are created if they are missing.- Parameters:
aDir- The directory to be created. May not benull.- Returns:
- A non-
nullerror code.
-
createDirRecursiveIfNotExisting
Create a new directory if it does not exist. The direct parent directory already needs to exist.- Parameters:
aDir- The directory to be created if it does not exist. May not benull.- Returns:
- A non-
nullerror code.
-
deleteDir
Delete an existing directory. The directory needs to be empty before it can be deleted.- Parameters:
aDir- The directory to be deleted. May not benull.- Returns:
- A non-
nullerror code.
-
deleteDirIfExisting
Delete an existing directory if it is existing. The directory needs to be empty before it can be deleted.- Parameters:
aDir- The directory to be deleted. May not benull.- Returns:
- A non-
nullerror code.
-
deleteDirRecursive
Delete an existing directory including all child objects.- Parameters:
aDir- The directory to be deleted. May not benull.- Returns:
- A non-
nullerror code.
-
deleteDirRecursiveIfExisting
Delete an existing directory including all child objects if it is existing.- Parameters:
aDir- The directory to be deleted. May not benull.- Returns:
- A non-
nullerror code.
-
deleteFile
Delete an existing file.- Parameters:
aFile- The file to be deleted. May not benull.- Returns:
- A non-
nullerror code.
-
deleteFileIfExisting
Delete a file if it is existing.- Parameters:
aFile- The file to be deleted. May not benull.- Returns:
- A non-
nullerror code.
-
renameDir
Rename a directory.- Parameters:
aSourceDir- The original directory name. May not benull.aTargetDir- The destination directory name. May not benull.- Returns:
- A non-
nullerror code.
-
renameFile
Rename a file.- Parameters:
aSourceFile- The original file name. May not benull.aTargetFile- The destination file name. May not benull.- Returns:
- A non-
nullerror code.
-
copyDirRecursive
Copy a directory including all child objects.- Parameters:
aSourceDir- The source directory to be copied. May not benull.aTargetDir- The destination directory where to be copied. This directory may not be existing. May not benull.- Returns:
- A non-
nullerror code.
-
copyFile
Copies the source file to the target file.- Parameters:
aSourceFile- The source file to use. May not benull. Needs to be an existing file.aTargetFile- The destination files. May not benulland may not be an existing file.- Returns:
- A non-
nullerror code.
-