|
RSE Release 3.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.runtime.PlatformObject
org.eclipse.rse.services.AbstractService
org.eclipse.rse.services.files.AbstractFileService
public abstract class AbstractFileService
Field Summary |
---|
Fields inherited from interface org.eclipse.rse.services.files.IFileService |
---|
APPEND, FILE_TYPE_FILES, FILE_TYPE_FILES_AND_FOLDERS, FILE_TYPE_FOLDERS, NONE, TEXT_MODE |
Constructor Summary | |
---|---|
AbstractFileService()
|
Method Summary | |
---|---|
void |
deleteBatch(String[] remoteParents,
String[] fileNames,
IProgressMonitor monitor)
Delete a set of files or folders on the host. |
void |
downloadMultiple(String[] remoteParents,
String[] remoteFiles,
File[] localFiles,
boolean[] isBinaries,
String[] hostEncodings,
IProgressMonitor monitor)
Copy files from the remote file system to the local system. Default implementation - just iterate through each file |
String |
getEncoding(IProgressMonitor monitor)
Returns the local platform encoding by default. |
void |
getFileMultiple(String[] remoteParents,
String[] names,
List hostFiles,
IProgressMonitor monitor)
Get multiple abstract remote file handles for an array of specified paths. |
InputStream |
getInputStream(String remoteParent,
String remoteFile,
boolean isBinary,
IProgressMonitor monitor)
Get the input stream to access the contents a remote file. The default implementation returns null . |
OutputStream |
getOutputStream(String remoteParent,
String remoteFile,
boolean isBinary,
IProgressMonitor monitor)
Deprecated. use getOutputStream(String, String, int, IProgressMonitor)
instead |
OutputStream |
getOutputStream(String remoteParent,
String remoteFile,
int options,
IProgressMonitor monitor)
Get the output stream to write/append to a remote file. The default implementation returns null . |
protected abstract IHostFile[] |
internalFetch(String parentPath,
String fileFilter,
int fileType,
IProgressMonitor monitor)
|
protected boolean |
isRightType(int fileType,
IHostFile node)
|
IHostFile[] |
list(String remoteParent,
String fileFilter,
int fileType,
IProgressMonitor monitor)
List the contents of a remote folder. |
void |
listMultiple(String[] remoteParents,
String[] fileFilters,
int[] fileTypes,
List hostFiles,
IProgressMonitor monitor)
List the contents of multiple remote folders. |
void |
listMultiple(String[] remoteParents,
String[] fileFilters,
int fileType,
List hostFiles,
IProgressMonitor monitor)
List the contents of multiple remote folders. |
protected IProgressMonitor |
progressTick(IProgressMonitor monitor)
Perform a single progress tick for default multi-operations, provided that a valid progress monitor is passed in: Checks the monitor for cancellation and throws SystemOperationCancelledException if it is Creates a SubMonitor for a single progress tick on the original monitor |
boolean |
supportsEncodingConversion()
The default implementation returns false. |
void |
uploadMultiple(File[] localFiles,
String[] remoteParents,
String[] remoteFiles,
boolean[] isBinaries,
String[] srcEncodings,
String[] hostEncodings,
IProgressMonitor monitor)
Copy files to the remote file system. Default implementation - just iterate through each file |
Methods inherited from class org.eclipse.rse.services.AbstractService |
---|
getDescription, getName, initService, uninitService |
Methods inherited from class org.eclipse.core.runtime.PlatformObject |
---|
getAdapter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.rse.services.files.IFileService |
---|
copy, copyBatch, createFile, createFolder, delete, download, getFile, getRoots, getUserHome, isCaseSensitive, move, rename, rename, setLastModified, setReadOnly, upload, upload |
Methods inherited from interface org.eclipse.rse.services.IService |
---|
getDescription, getName, initService, uninitService |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
---|
getAdapter |
Constructor Detail |
---|
public AbstractFileService()
Method Detail |
---|
protected IProgressMonitor progressTick(IProgressMonitor monitor) throws SystemMessageException
monitor
- Progress Monitor to use
SystemOperationCancelledException
- in case the user cancelled
SystemMessageException
protected abstract IHostFile[] internalFetch(String parentPath, String fileFilter, int fileType, IProgressMonitor monitor) throws SystemMessageException
SystemMessageException
public void getFileMultiple(String[] remoteParents, String[] names, List hostFiles, IProgressMonitor monitor) throws SystemMessageException
If an error occurs during the retrieval an item, this operation stops on that item and a SystemMessageException
is thrown.
Items retrieved before that item will be returned. Items to be retrieved after that item will not be retrieved.
The items on which the error occurs will not be retrieved.
getFileMultiple
in interface IFileService
remoteParents
- - the list of remote parentsnames
- - the list of file nameshostFiles
- a list to which the retrieved IHostFile
objects will be appendedmonitor
- the monitor for this potentially long running operation
SystemMessageException
- if an error occurs. Typically this would
be one of those in the RemoteFileException family.public IHostFile[] list(String remoteParent, String fileFilter, int fileType, IProgressMonitor monitor) throws SystemMessageException
list
in interface IFileService
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.fileType
- - indicates whether to query files, folders, both or some
other typemonitor
- the monitor for this potentially long running operation
SystemMessageException
- if an error occurs. Typically this would
be one of those in the RemoteFileException family. Exceptions
are particularly expected when the remoteParent does not
exist, or is not a folder.public void listMultiple(String[] remoteParents, String[] fileFilters, int[] fileTypes, List hostFiles, IProgressMonitor monitor) throws SystemMessageException
If an error occurs during the retrieval of the contents of a folder, this
operation stops on that folder and a SystemMessageException
is
thrown. Items retrieved before that folder will be returned. Items in
folders after that folder will not be retrieved. The items in the folder
on which the error occurs will not be returned.
listMultiple
in interface IFileService
remoteParents
- - the names of the parent directories on the remote
file system from which to retrieve the collective child list.fileFilters
- - a set of strings that can be used to filter the
children. Only those files matching the filter corresponding
to it's remoteParent make it into the list. The interface does
not dictate where the filtering occurs. For each remoteParent,
there must be a corresponding fileFilter.fileTypes
- - indicates whether to query files, folders, both or
some other type. For each remoteParent, there must be a
corresponding fileType. For the default list of available file
types see IFileServiceContants
hostFiles
- a list to which the found IHostFile
objects will
be appendedmonitor
- the monitor for this potentially long running operation
SystemMessageException
- if an error occurs. Typically this would
be one of those in the RemoteFileException family. Exceptions
are particularly expected when a remoteParent does not exist,
or is not a folder.public void listMultiple(String[] remoteParents, String[] fileFilters, int fileType, List hostFiles, IProgressMonitor monitor) throws SystemMessageException
If an error occurs during the retrieval of the contents of a folder, this
operation stops on that folder and a SystemMessageException
is
thrown. Items retrieved before that folder will be returned. Items in
folders after that folder will not be retrieved. The items in the folder
on which the error occurs will not be returned.
listMultiple
in interface IFileService
remoteParents
- - the names of the parent directories on the remote
file system from which to retrieve the collective child list.fileFilters
- - a set of strings that can be used to filter the
children. Only those files matching the filter corresponding
to it's remoteParent make it into the list. The interface does
not dictate where the filtering occurs. For each remoteParent,
there must be a corresponding fileFilter.fileType
- - indicates whether to query files, folders, both or some
other type. All results will be of the specified type. For the
default list of available file types see
IFileServiceContants
hostFiles
- a list to which the found IHostFile
objects will
be appendedmonitor
- the monitor for this potentially long running operation
SystemMessageException
- if an error occurs. Typically this would
be one of those in the RemoteFileException family. Exceptions
are particularly expected when a remoteParent does not exist,
or is not a folder.protected boolean isRightType(int fileType, IHostFile node)
public void deleteBatch(String[] remoteParents, String[] fileNames, IProgressMonitor monitor) throws SystemMessageException
If an error occurs during the deletion of an item, this operation stops on that item and a SystemMessageException
is thrown.
Items deleted before that item will remain deleted. Items specified after that item will not be deleted.
The item on which the error occurs will not be deleted.
deleteBatch
in interface IFileService
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.public void downloadMultiple(String[] remoteParents, String[] remoteFiles, File[] localFiles, boolean[] isBinaries, String[] hostEncodings, IProgressMonitor monitor) throws SystemMessageException
If an error occurs during the download of a file, this operation stops on that file and a SystemMessageException
is thrown.
Files downloaded before that file will remain downloaded. Files in the list after that file will not be downloaded.
The file on which the error occurs will not be downloaded. Default implementation - just iterate through each file
downloadMultiple
in interface IFileService
remoteParents
- - string designating the remote parents.remoteFiles
- - Strings designating the remote files residing in the
parents.localFiles
- - The files that are to be written. If the files exists
they are overwritten.isBinaries
- - indicates whether the files are text on binaryhostEncodings
- - the encodings 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.public void uploadMultiple(File[] localFiles, String[] remoteParents, String[] remoteFiles, boolean[] isBinaries, String[] srcEncodings, String[] hostEncodings, IProgressMonitor monitor) throws SystemMessageException
If an error occurs during the upload of a file, this operation stops on that file and a SystemMessageException
is thrown.
Files uploaded before that file will remain uploaded. Files in the list after that file will not be uploaded.
The file on which the error occurs will not be uploaded. Default implementation - just iterate through each file
uploadMultiple
in interface IFileService
localFiles
- - real files in the local file system.remoteParents
- - strings designating the parent folders of the target for the files.remoteFiles
- - strings designating the names of the files to be written on the remote system.isBinaries
- - indicates whether the files are text or binarysrcEncodings
- - the src encodings of the files (if text)hostEncodings
- - the tgt encodings of the files (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.public String getEncoding(IProgressMonitor monitor) throws SystemMessageException
getEncoding
in interface IFileService
monitor
- the progress monitor.
SystemMessageException
- if an error occurs.IFileService.getEncoding(org.eclipse.core.runtime.IProgressMonitor)
public InputStream getInputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor) throws SystemMessageException
null
.
Clients can override to return an input stream to the file.
getInputStream
in interface IFileService
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. Only used for the process of opening
the Stream. Implementations are not expected to use or update
the monitor for actual Stream transfer operations.
SystemMessageException
- if an error occurs.IFileService.getInputStream(String,
String, boolean, IProgressMonitor)
public OutputStream getOutputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor) throws SystemMessageException
getOutputStream(String, String, int, IProgressMonitor)
instead
null
.
Clients can override to return an output stream to the file.
getOutputStream
in interface IFileService
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. Only used for the process of opening
the Stream. Implementations are not expected to use or update
the monitor for actual Stream transfer operations.
SystemMessageException
- if an error occurs.public OutputStream getOutputStream(String remoteParent, String remoteFile, int options, IProgressMonitor monitor) throws SystemMessageException
null
.
Clients can override to return an output stream to the file.
getOutputStream
in interface IFileService
remoteParent
- the absolute path of the parent.remoteFile
- the name of the remote file.options
- bit wise or of option constants. Valid constants are
IFileService.APPEND
, IFileService.TEXT_MODE
,
and IFileService.NONE
monitor
- the progress monitor. Only used for the process of opening
the Stream. Implementations are not expected to use or update
the monitor for actual Stream transfer operations.
SystemMessageException
- if an error occurs.IFileService.getOutputStream(String,
String, int, IProgressMonitor)
public boolean supportsEncodingConversion()
supportsEncodingConversion
in interface IFileService
|
RSE Release 3.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |