|
RSE Release 2.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IFileService
A IFileService is an abstraction of a file service that runs over some sort of connection. It can be shared among multiple instances of a subsystem. At some point this file service layer may become official API but for now it is experimental. Each subsystem is currently responsible for layering an abstraction over whatever it wants to construct as a service.
This is a very bare bones definition. A real definition would probably have changed terminology, use URI's rather than Strings, and have much more robust error handling.
Implementers of this interface will have to either be instantiated, initialized, or somehow derive a connection as part of its state.
| Method Summary | |
|---|---|
boolean |
copy(String srcParent,
String srcName,
String tgtParent,
String tgtName,
IProgressMonitor monitor)
Copy the file or folder to the specified destination |
boolean |
copyBatch(String[] srcParents,
String[] srcNames,
String tgtParent,
IProgressMonitor monitor)
Copy a set of files or folders to the specified destination |
IHostFile |
createFile(String remoteParent,
String fileName,
IProgressMonitor monitor)
Create a file on the host |
IHostFile |
createFolder(String remoteParent,
String folderName,
IProgressMonitor monitor)
Create a folder on the host |
boolean |
delete(String remoteParent,
String fileName,
IProgressMonitor monitor)
Deletes a file or folder on the host |
boolean |
deleteBatch(String[] remoteParents,
String[] fileNames,
IProgressMonitor monitor)
Deletes a set of files or folders on the host. |
boolean |
download(String remoteParent,
String remoteFile,
File localFile,
boolean isBinary,
String hostEncoding,
IProgressMonitor monitor)
Copy a file from the remote file system to the local system. |
String |
getEncoding(IProgressMonitor monitor)
Gets the remote encoding. |
IHostFile |
getFile(String remoteParent,
String name,
IProgressMonitor monitor)
|
IHostFile[] |
getFiles(String remoteParent,
String fileFilter,
IProgressMonitor monitor)
|
IHostFile[] |
getFilesAndFolders(String remoteParent,
String fileFilter,
IProgressMonitor monitor)
|
IHostFile[] |
getFolders(String remoteParent,
String fileFilter,
IProgressMonitor monitor)
|
InputStream |
getInputStream(String remoteParent,
String remoteFile,
boolean isBinary,
IProgressMonitor monitor)
Gets the input stream to access the contents a remote file. |
OutputStream |
getOutputStream(String remoteParent,
String remoteFile,
boolean isBinary,
IProgressMonitor monitor)
Gets the output stream to write to a remote file. |
IHostFile[] |
getRoots(IProgressMonitor monitor)
|
IHostFile |
getUserHome()
|
boolean |
isCaseSensitive()
Indicates whether the file system is case sensitive |
boolean |
move(String srcParent,
String srcName,
String tgtParent,
String tgtName,
IProgressMonitor monitor)
Move the file or folder specified |
boolean |
rename(String remoteParent,
String oldName,
String newName,
IHostFile oldFile,
IProgressMonitor monitor)
Renames a file or folder on the host |
boolean |
rename(String remoteParent,
String oldName,
String newName,
IProgressMonitor monitor)
Renames a file or folder on the host |
boolean |
setLastModified(String parent,
String name,
long timestamp,
IProgressMonitor monitor)
Sets the last modified stamp of the file or folder with the specified timestamp |
boolean |
setReadOnly(String parent,
String name,
boolean readOnly,
IProgressMonitor monitor)
Sets the readonly permission of the file or folder |
boolean |
upload(File localFile,
String remoteParent,
String remoteFile,
boolean isBinary,
String srcEncoding,
String hostEncoding,
IProgressMonitor monitor)
Copy a file to the remote file system. |
boolean |
upload(InputStream stream,
String remoteParent,
String remoteFile,
boolean isBinary,
String hostEncoding,
IProgressMonitor monitor)
Copy a file to the remote file system. |
| Methods inherited from interface org.eclipse.rse.services.IService |
|---|
getDescription, getMessage, getName, initService, uninitService |
| Method Detail |
|---|
boolean upload(InputStream stream,
String remoteParent,
String remoteFile,
boolean isBinary,
String hostEncoding,
IProgressMonitor monitor)
throws SystemMessageException
stream - input stream to transferremoteParent - - a string designating the parent folder of the target for this file.remoteFile - - a string designating the name of the file to be written on the remote system.isBinary - - indicates whether the file is text or binaryhostEncoding - - the tgt encoding of the file (if text)monitor - the monitor for this potentially long running operation
SystemMessageException - if an error occurs.
Typically this would be one of those in the RemoteFileException family.
boolean upload(File localFile,
String remoteParent,
String remoteFile,
boolean isBinary,
String srcEncoding,
String hostEncoding,
IProgressMonitor monitor)
throws SystemMessageException
localFile - - a real file in the local file system.remoteParent - - a string designating the parent folder of the target for this file.remoteFile - - a string designating the name of the file to be written on the remote system.isBinary - - indicates whether the file is text or binarysrcEncoding - - the src encoding of the file (if text)hostEncoding - - the tgt encoding of the file (if text)monitor - the monitor for this potentially long running operation
SystemMessageException - if an error occurs.
Typically this would be one of those in the
RemoteFileException family.
boolean download(String remoteParent,
String remoteFile,
File localFile,
boolean isBinary,
String hostEncoding,
IProgressMonitor monitor)
throws SystemMessageException
remoteParent - - a String designating the remote parent.remoteFile - - a String designating the remote file residing in the parent.localFile - - The file that is to be written. If the file exists it is
overwritten.isBinary - - indicates whether the file is text on binaryhostEncoding - - the encoding on the host (if text)monitor - the monitor for this potentially long running operation
SystemMessageException - if an error occurs.
Typically this would be one of those in the
RemoteFileException family.
IHostFile getFile(String remoteParent,
String name,
IProgressMonitor monitor)
throws SystemMessageException
remoteParent - name - monitor - the monitor for this potentially long running operation
SystemMessageException - if an error occurs.
Typically this would be one of those in the RemoteFileException family.
IHostFile[] getFilesAndFolders(String remoteParent,
String fileFilter,
IProgressMonitor monitor)
throws SystemMessageException
remoteParent - - the name of the parent directory on the remote file
system from which to retrieve the child list.fileFilter - - a string that can be used to filter the children. Only
those files matching the filter make it into the list. The interface
does not dictate where the filtering occurs.monitor - the monitor for this potentially long running operation
SystemMessageException - if an error occurs.
Typically this would be one of those in the RemoteFileException family.
IHostFile[] getFiles(String remoteParent,
String fileFilter,
IProgressMonitor monitor)
throws SystemMessageException
remoteParent - - the name of the parent directory on the remote file
system from which to retrieve the child list.fileFilter - - a string that can be used to filter the children. Only
those files matching the filter make it into the list. The interface
does not dictate where the filtering occurs.monitor - the monitor for this potentially long running operation
SystemMessageException - if an error occurs.
Typically this would be one of those in the RemoteFileException family.
IHostFile[] getFolders(String remoteParent,
String fileFilter,
IProgressMonitor monitor)
throws SystemMessageException
remoteParent - - the name of the parent directory on the remote file
system from which to retrieve the child list.fileFilter - - a string that can be used to filter the children. Only
those files matching the filter make it into the list. The interface
does not dictate where the filtering occurs.monitor - the monitor for this potentially long running operation
SystemMessageException - if an error occurs.
Typically this would be one of those in the RemoteFileException family.
IHostFile[] getRoots(IProgressMonitor monitor)
throws SystemMessageException
monitor - the monitor for this potentially long running operation
Return the list of roots for this system
SystemMessageException - if an error occurs.
Typically this would be one of those in the RemoteFileException family.IHostFile getUserHome()
IHostFile createFile(String remoteParent,
String fileName,
IProgressMonitor monitor)
throws SystemMessageException
remoteParent - the parent directoryfileName - the name of the new filemonitor - the monitor for this potentially long running operation
SystemMessageException - if an error occurs.
Typically this would be one of those in the RemoteFileException family.
IHostFile createFolder(String remoteParent,
String folderName,
IProgressMonitor monitor)
throws SystemMessageException
remoteParent - the parent directoryfolderName - the name of the new foldermonitor - the progress monitor
SystemMessageException - if an error occurs.
Typically this would be one of those in the RemoteFileException family.
boolean delete(String remoteParent,
String fileName,
IProgressMonitor monitor)
throws SystemMessageException
remoteParent - the folder containing the file to deletefileName - the name of the file or folder to deletemonitor - the progress monitor
SystemMessageException - if an error occurs.
Typically this would be one of those in the RemoteFileException family.
boolean deleteBatch(String[] remoteParents,
String[] fileNames,
IProgressMonitor monitor)
throws SystemMessageException
remoteParents - the array of folders containing the files to deletefileNames - the names of the files or folders to deletemonitor - the progress monitor
SystemMessageException - if an error occurs.
Typically this would be one of those in the RemoteFileException family.
boolean rename(String remoteParent,
String oldName,
String newName,
IProgressMonitor monitor)
throws SystemMessageException
remoteParent - the folder containing the file to renameoldName - the old name of the file or folder to renamenewName - the new name for the filemonitor - the progress monitor
SystemMessageException - if an error occurs.
Typically this would be one of those in the RemoteFileException family.
boolean rename(String remoteParent,
String oldName,
String newName,
IHostFile oldFile,
IProgressMonitor monitor)
throws SystemMessageException
remoteParent - the folder containing the file to renameoldName - the old name of the file or folder to renamenewName - the new name for the fileoldFile - the file to update with the changemonitor - the progress monitor
SystemMessageException - if an error occurs.
Typically this would be one of those in the RemoteFileException family.
boolean move(String srcParent,
String srcName,
String tgtParent,
String tgtName,
IProgressMonitor monitor)
throws SystemMessageException
srcParent - the folder containing the file or folder to movesrcName - the new of the file or folder to movetgtParent - the destination folder for the movetgtName - the name of the moved file or foldermonitor - the progress monitor
SystemMessageException - if an error occurs.
Typically this would be one of those in the RemoteFileException family.
boolean copy(String srcParent,
String srcName,
String tgtParent,
String tgtName,
IProgressMonitor monitor)
throws SystemMessageException
srcParent - the folder containing the file or folder to copysrcName - the new of the file or folder to copytgtParent - the destination folder for the copytgtName - the name of the copied file or foldermonitor - the progress monitor
SystemMessageException - if an error occurs.
Typically this would be one of those in the RemoteFileException family.
boolean copyBatch(String[] srcParents,
String[] srcNames,
String tgtParent,
IProgressMonitor monitor)
throws SystemMessageException
srcParents - the folders containing each file or folder to copysrcNames - the names of the files or folders to copytgtParent - the destination folder for the copymonitor - the progress monitor
SystemMessageException - if an error occurs.
Typically this would be one of those in the RemoteFileException family.boolean isCaseSensitive()
boolean setLastModified(String parent,
String name,
long timestamp,
IProgressMonitor monitor)
throws SystemMessageException
parent - the parent path of the file to setname - the name of the file to settimestamp - the new timestampmonitor - the progress monitor
SystemMessageException
boolean setReadOnly(String parent,
String name,
boolean readOnly,
IProgressMonitor monitor)
throws SystemMessageException
parent - the parent path of the file to setname - the name of the file to setreadOnly - indicates whether to make the file readonly or read-writemonitor - the progress monitor
SystemMessageException
String getEncoding(IProgressMonitor monitor)
throws SystemMessageException
monitor - the progress monitor.
SystemMessageException - if an error occurs.
InputStream getInputStream(String remoteParent,
String remoteFile,
boolean isBinary,
IProgressMonitor monitor)
throws SystemMessageException
remoteParent - the absolute path of the parent.remoteFile - the name of the remote file.isBinary - true if the file is a binary file, false otherwise.monitor - the progress monitor.
SystemMessageException - if an error occurs.
OutputStream getOutputStream(String remoteParent,
String remoteFile,
boolean isBinary,
IProgressMonitor monitor)
throws SystemMessageException
remoteParent - the absolute path of the parent.remoteFile - the name of the remote file.isBinary - true if the file is a binary file, false otherwise.monitor - the progress monitor.
SystemMessageException - if an error occurs.
|
RSE Release 2.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||