|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface FileOperations
Abstraction for local/remote file operations on a machine. Operations on this interface are implemented by a machine which can be local or remote.
| Method Summary | |
|---|---|
void |
copy(File source,
File destDir)
copy the file from the local machine to the remote machine represented by this instance |
boolean |
delete(String path)
deletes a file or a directory on the target machine |
boolean |
exists(String path)
returns true if the path exists on the machine |
long |
length(String path)
Returns a file size |
void |
localCopy(String source,
String destDir)
copy the file on a remote machine from a source path to a destination path. |
List<String> |
ls(String path)
Returns a list of file names in the passed directory |
boolean |
mkdir(String destPath)
mkdir on the target machine |
Date |
mod(String path)
Returns the Date of the last modification of the file. |
boolean |
mv(String source,
String dest)
move a file within the file system |
| Method Detail |
|---|
boolean exists(String path)
throws IOException
path - path to a file or directory to check for existence
IOException - if the path cannot be checked.
Date mod(String path)
throws IOException
path - file path on the machine
IOException - if the operation fialed.
boolean mkdir(String destPath)
throws IOException
destPath - path to the directory to create
IOException - if the operation failed
boolean delete(String path)
throws IOException
path - path to the file to delete
IOException - if the operation failed
boolean mv(String source,
String dest)
throws IOException
source - the source path for the filedest - the destination path to move the file to
IOException - if the operation failed
void copy(File source,
File destDir)
throws IOException
source - the source file pathdestDir - the destination directory to copy the file to
IOException - if the operation failed
void localCopy(String source,
String destDir)
throws IOException
source - the source path.destDir - the destination directory to copy the file to
IOException - if the operation failed
long length(String path)
throws IOException
path - path to the file
IOException - if the file is not found
List<String> ls(String path)
throws IOException
directory - path
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||