|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FileAgent
This is the interface that is implemented by the FileAgent. The FileAgent is used to access any file remotely.
FileService
Field Summary | |
---|---|
static int |
APPEND
Open for write in append mode. |
static int |
READ
Open for reading. |
static int |
WRITE
Open for writing. |
Method Summary | |
---|---|
boolean |
doesFileExist(String fileName)
Checks whether the given remote file exists. |
FileTransfer |
get(String srcFile,
String destFile)
Gets a file from the local system to the master. |
String |
getProperty(String configFile,
String propName)
Gets a property from a given file. |
boolean |
isDirectory(String fileName)
Checks whether the given remote file exists and is a directory. |
boolean |
isFile(String fileName)
Checks whether the given remote file exists and is a normal file. |
FileService |
open(String file,
int mode)
Open a file for reading and/or writing. |
long |
push(FileTransfer transfer)
Pushes a file, as encapsulated in the FileTransfer, from a the master to this agent. |
String |
readWholeFile(String file)
Read a file from this machine and return the contents as a String. |
boolean |
removeFile(String fileName)
Remove a file. |
boolean |
removeFiles(String dirName,
FileFilter filter)
Remove files from a directory matched by the filter. |
boolean |
truncateFile(String fileName)
Truncates a file to zero-length. |
boolean |
writeWholeFile(String file,
String contents)
Write the given file to this machine. |
Field Detail |
---|
static final int READ
static final int WRITE
static final int APPEND
Method Detail |
---|
FileService open(String file, int mode) throws RemoteException, FileServiceException
file
- filenamemode
- file open mode - READ, WRITE, APPEND
RemoteException
- A communications error occurred.
FileServiceException
- Error opening fileString readWholeFile(String file) throws IOException
file
- name of the file
IOException
- An I/O error occurredboolean writeWholeFile(String file, String contents) throws RemoteException
file
- pathcontents
- of the file.
RemoteException
- A communications error occurred.boolean removeFile(String fileName) throws RemoteException
fileName
- - The pathname for the file.
RemoteException
- A communications error occurred.boolean truncateFile(String fileName) throws RemoteException
fileName
- The pathname for the file
RemoteException
- An error occurred.boolean removeFiles(String dirName, FileFilter filter) throws RemoteException
dirName
- The directory path namefilter
- The filter
RemoteException
- A communications error occurred.String getProperty(String configFile, String propName) throws IOException
configFile
- The config file namepropName
- The property key name
IOException
- If there is an error accessing the config fileboolean doesFileExist(String fileName) throws RemoteException
fileName
- The file name to test.
RemoteException
- A communications error occurred.boolean isFile(String fileName) throws RemoteException
fileName
- The file name to test.
RemoteException
- A communications error occurred.boolean isDirectory(String fileName) throws RemoteException
fileName
- The file name to test.
RemoteException
- A communications error occurred.long push(FileTransfer transfer) throws RemoteException
transfer
- The file transfer description
RemoteException
- If there is an error in the transferFileTransfer get(String srcFile, String destFile) throws IOException
srcFile
- The source file on the host the agent is running ondestFile
- The destination file on the master
IOException
- If there is an error reading or transferring
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |