Package adams.core.io.fileoperations
Interface FileOperations
-
- All Known Subinterfaces:
RemoteFileOperations
- All Known Implementing Classes:
AbstractFileOperations
,AbstractRemoteFileOperations
,LocalFileOperations
,RemoteToRemoteFileOperations
,SftpFileOperations
,SmbFileOperations
public interface FileOperations
Interface for file operation facades.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
copy(String source, String target)
Copies a file/dir.String
delete(String path)
Deletes a file/dir.String
duplicate(String source, String target)
Duplicates a file/dir.boolean
isDir(String path)
Checks whether the path is a directory.boolean
isSupported(Operation op)
Checks whether the given operation is supported.String
mkdir(String dir)
Creates the directory.String
move(String source, String target)
Moves a file/dir.String
rename(String source, String target)
Renames a file/dir.
-
-
-
Method Detail
-
isSupported
boolean isSupported(Operation op)
Checks whether the given operation is supported.- Parameters:
op
- the operation to check- Returns:
- true if supported
-
copy
String copy(String source, String target)
Copies a file/dir.- Parameters:
source
- the source file/dirtarget
- the target file/dir- Returns:
- null if successful, otherwise error message
-
duplicate
String duplicate(String source, String target)
Duplicates a file/dir.- Parameters:
source
- the source filetarget
- the target file- Returns:
- null if successful, otherwise error message
-
move
String move(String source, String target)
Moves a file/dir.- Parameters:
source
- the source file/dirtarget
- the target file/dir- Returns:
- null if successful, otherwise error message
-
rename
String rename(String source, String target)
Renames a file/dir.- Parameters:
source
- the source file/dir (old)target
- the target file/dir (new)- Returns:
- null if successful, otherwise error message
-
delete
String delete(String path)
Deletes a file/dir.- Parameters:
path
- the file/dir to delete- Returns:
- null if successful, otherwise error message
-
mkdir
String mkdir(String dir)
Creates the directory.- Parameters:
dir
- the directory to create- Returns:
- null if successful, otherwise error message
-
isDir
boolean isDir(String path)
Checks whether the path is a directory.- Parameters:
path
- the path to check- Returns:
- true if path exists and is a directory
-
-