RSE
Release 2.0

org.eclipse.rse.subsystems.files.core.servicesubsystem
Class FileServiceSubSystem

java.lang.Object
  extended by org.eclipse.rse.core.model.RSEPersistableObject
      extended by org.eclipse.rse.core.model.PropertySetContainer
          extended by org.eclipse.rse.core.model.RSEModelObject
              extended by org.eclipse.rse.core.subsystems.SubSystem
                  extended by org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileSubSystem
                      extended by org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem
All Implemented Interfaces:
IAdaptable, ISchedulingRule, ISystemFilterPoolReferenceManagerProvider, IPropertySetContainer, IRSEModelObject, IRSEPersistableContainer, ICommunicationsListener, IRemoteObjectResolver, IServiceSubSystem, ISubSystem, IFileServiceSubSystem, IRemoteFileSubSystem

public final class FileServiceSubSystem
extends RemoteFileSubSystem
implements IFileServiceSubSystem


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.rse.core.subsystems.SubSystem
SubSystem.ChangeStatusJob, SubSystem.ConnectJob, SubSystem.DisconnectJob, SubSystem.DisplayErrorMessageJob, SubSystem.GetPropertiesJob, SubSystem.GetPropertyJob, SubSystem.ResolveAbsoluteJob, SubSystem.ResolveAbsolutesJob, SubSystem.ResolveRelativeJob, SubSystem.SetPropertiesJob, SubSystem.SetPropertyJob, SubSystem.SubSystemOperationJob, SubSystem.SystemMessageDialogRunnable
 
Field Summary
protected  IFileService _hostFileService
           
protected  IHostFileToRemoteFileAdapter _hostFileToRemoteFileAdapter
           
protected  ISearchService _hostSearchService
           
protected  ILanguageUtilityFactory _languageUtilityFactory
           
protected  IRemoteFile _userHome
           
 
Fields inherited from class org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileSubSystem
_cachedRemoteFiles, _searchHistory, currFilterString, DEFAULT_CONTEXT, DEFAULT_CONTEXT_NOFILTERSTRING, FILTERSTRING_LISTROOTS, folderNameMatcher, matcher, osCmdShell, osName, osVarsSet, osWindows, osWindows95, osWindowsNT
 
Fields inherited from class org.eclipse.rse.core.subsystems.SubSystem
_connectionError, _connectorService, _disconnecting, _hidden, _host, _name, _subsystemConfigurationId, cancelable, doConnection, filterPoolReferenceManager, OPERATION_CANCEL_SHELL, OPERATION_CONNECT, OPERATION_DISCONNECT, OPERATION_GET_PROPERTIES, OPERATION_GET_PROPERTY, OPERATION_REMOVE_SHELL, OPERATION_RESOLVE_ABSOLUTE, OPERATION_RESOLVE_ABSOLUTES, OPERATION_RESOLVE_RELATIVE, OPERATION_RUN_COMMAND, OPERATION_RUN_SHELL, OPERATION_SEND_COMMAND_TO_SHELL, OPERATION_SET_PROPERTIES, OPERATION_SET_PROPERTY, parentSubSystemConfiguration, pmDialog, previousUserIdKey, runInThread, saveFileName, shell, sortResults, SUBSYSTEM_FILE_NAME, supportsConnecting
 
Fields inherited from interface org.eclipse.rse.core.model.IRSEPersistableContainer
NO_CHILDREN
 
Fields inherited from interface org.eclipse.rse.core.model.IRSEPersistableContainer
NO_CHILDREN
 
Constructor Summary
FileServiceSubSystem(IHost host, IConnectorService connectorService, IFileService hostFileService, IHostFileToRemoteFileAdapter fileAdapter, ISearchService searchService)
           
 
Method Summary
 void cancelSearch(IHostSearchResultConfiguration searchConfig)
          Given a search configuration, cancel the search.
 boolean copy(IRemoteFile sourceFolderOrFile, IRemoteFile targetFolder, String newName, IProgressMonitor monitor)
          Copy a file or folder to a new target parent folder.
 boolean copyBatch(IRemoteFile[] sourceFolderOrFiles, IRemoteFile targetFolder, IProgressMonitor monitor)
          Copy a set of remote files or folders to a new target parent folder.
 IRemoteFile createFile(IRemoteFile fileToCreate, IProgressMonitor monitor)
          Create a new file, given its IRemoteFile object (these do not have to represent existing files).
 IRemoteFile createFolder(IRemoteFile folderToCreate, IProgressMonitor monitor)
          Create a new folder, given its IRemoteFile object (these do not have to represent existing folders) The parent folder must exist for this to succeed.
 IRemoteFile createFolders(IRemoteFile folderToCreate, IProgressMonitor monitor)
          Given an IRemoteFile for a folder, this will create that folder and any missing parent folders in its path.
 IHostSearchResultConfiguration createSearchConfiguration(IHostSearchResultSet resultSet, Object searchTarget, SystemSearchString searchString)
           
 boolean delete(IRemoteFile folderOrFile, IProgressMonitor monitor)
          Delete the given remote file or folder.
 boolean deleteBatch(IRemoteFile[] folderOrFiles, IProgressMonitor monitor)
          Delete the given batch of remote file or folder.
 void download(IRemoteFile file, String localpath, String encoding, IProgressMonitor monitor)
          Get the remote file and save it locally.
 IRemoteFileContext getContextFor(IRemoteFile file)
           
protected  IHostFile getFile(String parentPath, String fileName, IProgressMonitor monitor)
           
protected  IHostFile[] getFiles(String parentPath, String fileNameFilter, IProgressMonitor monitor)
           
protected  IHostFile[] getFilesAndFolders(String parentPath, String fileNameFilter, IProgressMonitor monitor)
           
 IFileService getFileService()
          Returns the file service used by this subsystem.
protected  IHostFile[] getFolders(String parentPath, String fileNameFilter, IProgressMonitor monitor)
           
 IHostFileToRemoteFileAdapter getHostFileToRemoteFileAdapter()
           
 InputStream getInputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor)
          Defers to the file service.
 ILanguageUtilityFactory getLanguageUtilityFactory()
          Returns a language utility factory associated with this subsystem.
 OutputStream getOutputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor)
          Defers to the file service.
 IRemoteFile getParentFolder(IRemoteFile folderOrFile, IProgressMonitor monitor)
          Given a folder or file, return its parent folder object.
 String getRemoteEncoding()
          Returns the encoding from the file service being used by this subsystem.
 IRemoteFile getRemoteFileObject(IRemoteFile parent, String folderOrFileName, IProgressMonitor monitor)
          Constructs an IRemoteFile object given an unqualified file or folder name and its parent folder object.
 IRemoteFile getRemoteFileObject(String folderOrFileName, IProgressMonitor monitor)
          Constructs and returns an IRemoteFile object given a fully-qualified file or folder name.
protected  IHostFile[] getRoots(IProgressMonitor monitor)
           
 ISearchService getSearchService()
           
 Class getServiceType()
           
 IRemoteFileContext getTheDefaultContext()
           
protected  IRemoteFile getUserHome()
           
 void initializeSubSystem(IProgressMonitor monitor)
          Initialize this subsystem instance after the corresponding IConnectorService connect method finishes.
protected  boolean isBinary(IRemoteFile source)
           
protected  boolean isBinary(String localEncoding, String hostEncoding, String remotePath)
           
 boolean isCaseSensitive()
          Return true if file names are case-sensitive.
 IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor)
          Return the array of IRemoteFile instances, matching the given pattern, that are contained in the given folder.
 IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor)
          Return a subsetted list of remote folders in the given parent folder on the remote system.
 IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor)
          Return a list of remote folders and files in the given folder.
 IRemoteFile[] listRoots(IRemoteFileContext context, IProgressMonitor monitor)
          Return a list of roots/drives on the remote system.
 boolean move(IRemoteFile sourceFolderOrFile, IRemoteFile targetFolder, String newName, IProgressMonitor monitor)
          Move a file or folder to a new target parent folder.
 boolean rename(IRemoteFile folderOrFile, String newName, IProgressMonitor monitor)
          Rename the given remote file or folder.
 void search(IHostSearchResultConfiguration searchConfig)
          Given a search configuration, searches for its results.
 void setFileService(IFileService service)
           
 void setHostFileToRemoteFileAdapter(IHostFileToRemoteFileAdapter hostFileAdapter)
           
 void setLanguageUtilityFactory(ILanguageUtilityFactory factory)
           
 boolean setLastModified(IRemoteFile folderOrFile, long newDate, IProgressMonitor monitor)
          Set the last modified date for the given file or folder.
 boolean setReadOnly(IRemoteFile folderOrFile, boolean readOnly, IProgressMonitor monitor)
          Set a files read-only permissions.
 void setSearchService(ISearchService service)
           
 void switchServiceFactory(IServiceSubSystemConfiguration fact)
          Switch to use another protocol
 void uninitializeSubSystem(IProgressMonitor monitor)
          Uninitialize this subsystem just after disconnect.
 void upload(String source, IRemoteFile destination, String encoding, IProgressMonitor monitor)
          Put the local copy of the remote file back to the remote location.
 void upload(String source, String srcEncoding, String remotePath, String rmtEncoding, IProgressMonitor monitor)
          Put the local copy of the remote file back to the remote location.
 
Methods inherited from class org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileSubSystem
accept, addResolvedFilterStringObjects, cacheRemoteFile, cacheRemoteFile, communicationsStateChange, doesFilterMatch, doesFilterStringListContentsOf, doesFilterStringMatch, getCachedRemoteFile, getContext, getContext, getCurrentFilterString, getDefaultContext, getDefaultContextNoFilterString, getFilterStringListRoots, getFirstParentFilterString, getLineSeparator, getLocalAddress, getObjectWithAbsoluteName, getParentFolderName, getParentRemoteFileSubSystemConfiguration, getPathSeparator, getPathSeparatorChar, getPropertyPage, getRemoteFileObjects, getRemoteSearchResultObject, getSeparator, getSeparatorChar, getTargetForFilter, getUnusedPort, internalResolveFilterString, internalResolveFilterString, internalResolveFilterStrings, internalResolveOneFilterString, isPassiveCommunicationsListener, isPrimarySubSystem, listFiles, listFiles, listFolders, listFolders, listFoldersAndFiles, listFoldersAndFiles, listRoots, removeCachedRemoteFile, removeCachedRemoteFile, runLocalCommand, setListValues, setListValues, sortResolvedFilterStringObjects, supportsEncoding
 
Methods inherited from class org.eclipse.rse.core.subsystems.SubSystem
checkIsConnected, clearLocalUserId, commit, connect, connect, connect, contains, deletingConnection, disconnect, disconnect, displayAsyncMsg, doesFilterListContentsOf, doesFilterTypeMatch, filterEventFilterCreated, filterEventFilterPoolReferenceCreated, filterEventFilterPoolReferenceDeleted, filterEventFilterPoolReferenceRenamed, filterEventFilterPoolReferenceReset, filterEventFilterPoolReferencesRePositioned, filterEventFilterPoolReferencesReset, filterEventFilterStringCreated, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, forceUserIdToUpperCase, getActiveWorkbenchShell, getActiveWorkbenchWindow, getAdapter, getCacheManager, getChildren, getConfigurationId, getConnectionOwnedFilterPoolName, getConnectionPrivateFilterPool, getConnectorService, getExecutedCommands, getFilterPoolReferenceManager, getFilterReferenceWithAbsoluteName, getHost, getHostAliasName, getHostName, getLocalUserId, getLocalUserId, getName, getPersistableChildren, getPersistableParent, getPreferencesKey, getPreferencesKey, getPrimarySubSystem, getProperties, getProperty, getQueryingMessage, getQueryingMessage, getRemoteAttribute, getResolvingMessage, getRunnableContext, getRunningMessage, getSettingMessage, getSettingMessage, getShell, getSubSystemConfiguration, getSystemFilterPoolReferenceManager, getSystemProfile, getSystemProfileName, getTargetsForFilter, getUniqueOwningSystemFilterPool, getUserId, getVendorAttribute, hasChildren, implicitConnect, internalConnect, internalDisconnect, internalGetProperties, internalGetProperty, internalSetProperties, internalSetProperty, isConflicting, isConnected, isConnectionError, isHidden, isOffline, promptForPassword, promptForPassword, renamingConnection, renamingProfile, resolveFilterString, resolveFilterString, resolveFilterStrings, scheduleJob, selectCommandSubSystem, setConfigurationId, setConnectionError, setConnectorService, setFilterPoolReferenceManager, setHidden, setHost, setName, setProperties, setProperty, setRemoteAttribute, setSubSystemConfiguration, setVendorAttribute, showConnectCancelledMessage, showConnectErrorMessage, showDisconnectCancelledMessage, showDisconnectErrorMessage, showOperationCancelledMessage, showOperationErrorMessage, showOperationMessage, supportsCaching
 
Methods inherited from class org.eclipse.rse.core.model.RSEModelObject
getDescription
 
Methods inherited from class org.eclipse.rse.core.model.PropertySetContainer
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 
Methods inherited from class org.eclipse.rse.core.model.RSEPersistableObject
compareStrings, isDirty, isTainted, setDirty, setTainted, setWasRestored, wasRestored
 
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.subsystems.files.core.subsystems.IRemoteFileSubSystem
getLineSeparator, getLocalAddress, getParentFolderName, getParentRemoteFileSubSystemConfiguration, getPathSeparator, getPathSeparatorChar, getRemoteFileObjects, getRemoteSearchResultObject, getSeparator, getSeparatorChar, getUnusedPort, listFiles, listFiles, listFolders, listFolders, listFoldersAndFiles, listFoldersAndFiles, listRoots, supportsEncoding
 
Methods inherited from interface org.eclipse.rse.core.subsystems.ISubSystem
checkIsConnected, clearLocalUserId, connect, connect, connect, deletingConnection, disconnect, disconnect, doesFilterListContentsOf, doesFilterMatch, doesFilterStringListContentsOf, doesFilterStringMatch, forceUserIdToUpperCase, getCacheManager, getChildren, getConfigurationId, getConnectorService, getFilterPoolReferenceManager, getHost, getHostAliasName, getLocalUserId, getName, getPrimarySubSystem, getProperties, getProperty, getSubSystemConfiguration, getSystemFilterPoolReferenceManager, getSystemProfile, getSystemProfileName, getTargetForFilter, getUserId, getVendorAttribute, hasChildren, isConnected, isConnectionError, isHidden, isOffline, isPrimarySubSystem, renamingConnection, renamingProfile, resolveFilterString, resolveFilterString, resolveFilterStrings, setConfigurationId, setConnectionError, setConnectorService, setFilterPoolReferenceManager, setHidden, setHost, setName, setProperties, setProperty, setSubSystemConfiguration, setVendorAttribute, supportsCaching
 
Methods inherited from interface org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider
filterEventFilterCreated, filterEventFilterPoolReferenceCreated, filterEventFilterPoolReferenceDeleted, filterEventFilterPoolReferenceRenamed, filterEventFilterPoolReferenceReset, filterEventFilterPoolReferencesRePositioned, filterEventFilterPoolReferencesReset, filterEventFilterStringCreated, getUniqueOwningSystemFilterPool
 
Methods inherited from interface org.eclipse.rse.core.subsystems.IRemoteObjectResolver
getObjectWithAbsoluteName
 
Methods inherited from interface org.eclipse.core.runtime.jobs.ISchedulingRule
contains, isConflicting
 
Methods inherited from interface org.eclipse.rse.core.model.IRSEModelObject
getDescription
 
Methods inherited from interface org.eclipse.rse.core.model.IPropertySetContainer
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 
Methods inherited from interface org.eclipse.rse.core.model.IRSEPersistableContainer
commit, getPersistableChildren, getPersistableParent, isDirty, isTainted, setDirty, setTainted, setWasRestored, wasRestored
 
Methods inherited from interface org.eclipse.rse.core.subsystems.ISubSystem
checkIsConnected, clearLocalUserId, connect, connect, connect, deletingConnection, disconnect, disconnect, doesFilterListContentsOf, doesFilterMatch, doesFilterStringListContentsOf, doesFilterStringMatch, forceUserIdToUpperCase, getCacheManager, getChildren, getConfigurationId, getConnectorService, getFilterPoolReferenceManager, getHost, getHostAliasName, getLocalUserId, getName, getPrimarySubSystem, getProperties, getProperty, getSubSystemConfiguration, getSystemFilterPoolReferenceManager, getSystemProfile, getSystemProfileName, getTargetForFilter, getUserId, getVendorAttribute, hasChildren, isConnected, isConnectionError, isHidden, isOffline, isPrimarySubSystem, renamingConnection, renamingProfile, resolveFilterString, resolveFilterString, resolveFilterStrings, setConfigurationId, setConnectionError, setConnectorService, setFilterPoolReferenceManager, setHidden, setHost, setName, setProperties, setProperty, setSubSystemConfiguration, setVendorAttribute, supportsCaching
 
Methods inherited from interface org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider
filterEventFilterCreated, filterEventFilterPoolReferenceCreated, filterEventFilterPoolReferenceDeleted, filterEventFilterPoolReferenceRenamed, filterEventFilterPoolReferenceReset, filterEventFilterPoolReferencesRePositioned, filterEventFilterPoolReferencesReset, filterEventFilterStringCreated, getUniqueOwningSystemFilterPool
 
Methods inherited from interface org.eclipse.rse.core.subsystems.IRemoteObjectResolver
getObjectWithAbsoluteName
 
Methods inherited from interface org.eclipse.core.runtime.jobs.ISchedulingRule
contains, isConflicting
 
Methods inherited from interface org.eclipse.rse.core.model.IRSEModelObject
getDescription
 
Methods inherited from interface org.eclipse.rse.core.model.IPropertySetContainer
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 
Methods inherited from interface org.eclipse.rse.core.model.IRSEPersistableContainer
commit, getPersistableChildren, getPersistableParent, isDirty, isTainted, setDirty, setTainted, setWasRestored, wasRestored
 

Field Detail

_languageUtilityFactory

protected ILanguageUtilityFactory _languageUtilityFactory

_hostFileService

protected IFileService _hostFileService

_hostSearchService

protected ISearchService _hostSearchService

_hostFileToRemoteFileAdapter

protected IHostFileToRemoteFileAdapter _hostFileToRemoteFileAdapter

_userHome

protected IRemoteFile _userHome
Constructor Detail

FileServiceSubSystem

public FileServiceSubSystem(IHost host,
                            IConnectorService connectorService,
                            IFileService hostFileService,
                            IHostFileToRemoteFileAdapter fileAdapter,
                            ISearchService searchService)
Method Detail

isCaseSensitive

public boolean isCaseSensitive()
Description copied from class: RemoteFileSubSystem
Return true if file names are case-sensitive. Used when doing name or type filtering Default is false, but can be overridden.

Specified by:
isCaseSensitive in interface IRemoteFileSubSystem
Overrides:
isCaseSensitive in class RemoteFileSubSystem

getContextFor

public IRemoteFileContext getContextFor(IRemoteFile file)

getTheDefaultContext

public IRemoteFileContext getTheDefaultContext()

getFileService

public IFileService getFileService()
Description copied from interface: IFileServiceSubSystem
Returns the file service used by this subsystem. By wrapping this service we can easily share it among connections or subsystems if that is desired.

Specified by:
getFileService in interface IFileServiceSubSystem
Returns:
the file service wrapped by this subsystem.

setFileService

public void setFileService(IFileService service)

getSearchService

public ISearchService getSearchService()

setSearchService

public void setSearchService(ISearchService service)

getHostFileToRemoteFileAdapter

public IHostFileToRemoteFileAdapter getHostFileToRemoteFileAdapter()
Specified by:
getHostFileToRemoteFileAdapter in interface IFileServiceSubSystem

setHostFileToRemoteFileAdapter

public void setHostFileToRemoteFileAdapter(IHostFileToRemoteFileAdapter hostFileAdapter)

getRemoteFileObject

public IRemoteFile getRemoteFileObject(IRemoteFile parent,
                                       String folderOrFileName,
                                       IProgressMonitor monitor)
                                throws SystemMessageException
Constructs an IRemoteFile object given an unqualified file or folder name and its parent folder object.

Specified by:
getRemoteFileObject in interface IRemoteFileSubSystem
Parameters:
parent - Folder containing the folder or file
folderOrFileName - Un-qualified folder or file name
monitor - the progress monitor
Returns:
an IRemoteFile object for the file.
Throws:
SystemMessageException
See Also:
IRemoteFile

getRemoteFileObject

public IRemoteFile getRemoteFileObject(String folderOrFileName,
                                       IProgressMonitor monitor)
                                throws SystemMessageException
Constructs and returns an IRemoteFile object given a fully-qualified file or folder name.

Specified by:
getRemoteFileObject in interface IRemoteFileSubSystem
Parameters:
folderOrFileName - Fully qualified folder or file name
monitor - the progress monitor
Returns:
The constructed IRemoteFile
Throws:
SystemMessageException - in case an error occurs contacting the remote system while retrieving the requested remote object.
See Also:
IRemoteFile

getUserHome

protected IRemoteFile getUserHome()
Returns:
The IRemoteFile that is the user's home directory on this remote file system. The remote file system is assumed to have a concept of a home directory.

getFolders

protected IHostFile[] getFolders(String parentPath,
                                 String fileNameFilter,
                                 IProgressMonitor monitor)
                          throws SystemMessageException
Throws:
SystemMessageException

getFiles

protected IHostFile[] getFiles(String parentPath,
                               String fileNameFilter,
                               IProgressMonitor monitor)
                        throws SystemMessageException
Throws:
SystemMessageException

getFilesAndFolders

protected IHostFile[] getFilesAndFolders(String parentPath,
                                         String fileNameFilter,
                                         IProgressMonitor monitor)
                                  throws SystemMessageException
Throws:
SystemMessageException

getFile

protected IHostFile getFile(String parentPath,
                            String fileName,
                            IProgressMonitor monitor)
                     throws SystemMessageException
Throws:
SystemMessageException

getRoots

protected IHostFile[] getRoots(IProgressMonitor monitor)
                        throws InterruptedException,
                               SystemMessageException
Throws:
InterruptedException
SystemMessageException

listFoldersAndFiles

public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent,
                                         String fileNameFilter,
                                         IRemoteFileContext context,
                                         IProgressMonitor monitor)
                                  throws SystemMessageException
Return a list of remote folders and files in the given folder.

The files part of the list is subsetted by the given file name filter. It can be null for no subsetting. This version is called by RemoteFileSubSystemImpl's resolveFilterString(s).

Specified by:
listFoldersAndFiles in interface IRemoteFileSubSystem
Parameters:
parent - The parent folder to list folders and files in
fileNameFilter - The name pattern to subset the file list by, or null to return all files.
context - The holder of state information
monitor - the progress monitor
Throws:
SystemMessageException

listFiles

public IRemoteFile[] listFiles(IRemoteFile parent,
                               String fileNameFilter,
                               IRemoteFileContext context,
                               IProgressMonitor monitor)
                        throws SystemMessageException
Return the array of IRemoteFile instances, matching the given pattern, that are contained in the given folder. This version is called by RemoteFileSubSystemImpl's resolveFilterString(s)

Specified by:
listFiles in interface IRemoteFileSubSystem
Parameters:
parent - The parent folder to list files in
fileNameFilter - The name pattern to subset the list by, or null to return all files.
context - The holder of state information
monitor - the progress monitor
Throws:
SystemMessageException

listFolders

public IRemoteFile[] listFolders(IRemoteFile parent,
                                 String fileNameFilter,
                                 IRemoteFileContext context,
                                 IProgressMonitor monitor)
                          throws SystemMessageException
Return a subsetted list of remote folders in the given parent folder on the remote system. This version is called by RemoteFileSubSystemImpl's resolveFilterString(s)

Specified by:
listFolders in interface IRemoteFileSubSystem
Parameters:
parent - The parent folder to list folders in
fileNameFilter - The name pattern for subsetting the file list when this folder is subsequently expanded
context - The holder of state information
monitor - the progress monitor
Throws:
SystemMessageException

listRoots

public IRemoteFile[] listRoots(IRemoteFileContext context,
                               IProgressMonitor monitor)
                        throws InterruptedException
Description copied from interface: IRemoteFileSubSystem
Return a list of roots/drives on the remote system. This version is called by RemoteFileSubSystemImpl's resolveFilterString(s) noteThis method should be abstract but MOF doesn't allow abstract impl classes at this point

Specified by:
listRoots in interface IRemoteFileSubSystem
Throws:
InterruptedException

download

public void download(IRemoteFile file,
                     String localpath,
                     String encoding,
                     IProgressMonitor monitor)
              throws SystemMessageException
Description copied from interface: IRemoteFileSubSystem
Get the remote file and save it locally. The file is saved in the encoding specified, with two exceptions:

Specified by:
download in interface IRemoteFileSubSystem
Parameters:
file - remote file that represents the file to be obtained
localpath - the absolute path of the local file
encoding - the encoding of the local file
monitor - the progress monitor
Throws:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.

isBinary

protected boolean isBinary(String localEncoding,
                           String hostEncoding,
                           String remotePath)

isBinary

protected boolean isBinary(IRemoteFile source)

upload

public void upload(String source,
                   String srcEncoding,
                   String remotePath,
                   String rmtEncoding,
                   IProgressMonitor monitor)
            throws SystemMessageException
Description copied from interface: IRemoteFileSubSystem
Put the local copy of the remote file back to the remote location. The file is assumed to be in the encoding of the local operating system, with two exceptions:

Specified by:
upload in interface IRemoteFileSubSystem
Parameters:
source - the absolute path of the local copy
srcEncoding - the encoding of the local copy
remotePath - remote file that represents the file on the server
rmtEncoding - the encoding of the remote file.
Throws:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.

upload

public void upload(String source,
                   IRemoteFile destination,
                   String encoding,
                   IProgressMonitor monitor)
            throws SystemMessageException
Description copied from interface: IRemoteFileSubSystem
Put the local copy of the remote file back to the remote location. The file is assumed to be in the encoding specified, with two exceptions:

Specified by:
upload in interface IRemoteFileSubSystem
Parameters:
source - the absolute path of the local copy
destination - remote file that represents the file on the server
encoding - the encoding of the local copy
monitor - the progress monitor
Throws:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.

copy

public boolean copy(IRemoteFile sourceFolderOrFile,
                    IRemoteFile targetFolder,
                    String newName,
                    IProgressMonitor monitor)
             throws SystemMessageException
Description copied from interface: IRemoteFileSubSystem
Copy a file or folder to a new target parent folder.

Specified by:
copy in interface IRemoteFileSubSystem
Parameters:
sourceFolderOrFile - The file or folder to copy
targetFolder - The folder to copy to. No guarantee it is on the same system, so be sure to check getSystemConnection()!
newName - The new name for the copied file or folder
monitor - progress monitor
Returns:
true if the copy succeeded
Throws:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.

copyBatch

public boolean copyBatch(IRemoteFile[] sourceFolderOrFiles,
                         IRemoteFile targetFolder,
                         IProgressMonitor monitor)
                  throws SystemMessageException
Description copied from interface: IRemoteFileSubSystem
Copy a set of remote files or folders to a new target parent folder. Precondition: Sources and target must all be on the same system!

Specified by:
copyBatch in interface IRemoteFileSubSystem
Parameters:
sourceFolderOrFiles - The file or folder to copy
targetFolder - The folder to copy to.
monitor - progress monitor
Returns:
true if all copies succeeded
Throws:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.

getParentFolder

public IRemoteFile getParentFolder(IRemoteFile folderOrFile,
                                   IProgressMonitor monitor)
Description copied from interface: IRemoteFileSubSystem
Given a folder or file, return its parent folder object.

Specified by:
getParentFolder in interface IRemoteFileSubSystem
Parameters:
folderOrFile - folder or file to return parent of.
monitor - the progress monitor
Returns:
the remote file

createFile

public IRemoteFile createFile(IRemoteFile fileToCreate,
                              IProgressMonitor monitor)
                       throws SystemMessageException
Description copied from interface: IRemoteFileSubSystem
Create a new file, given its IRemoteFile object (these do not have to represent existing files).

Specified by:
createFile in interface IRemoteFileSubSystem
Parameters:
fileToCreate - The object representing the file to be created.
Returns:
The same input object returned for convenience. Will throw exception if it fails.
Throws:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.
See Also:
IRemoteFileSubSystem.createFolders(IRemoteFile,IProgressMonitor)

createFolder

public IRemoteFile createFolder(IRemoteFile folderToCreate,
                                IProgressMonitor monitor)
                         throws SystemMessageException
Description copied from interface: IRemoteFileSubSystem
Create a new folder, given its IRemoteFile object (these do not have to represent existing folders)

Specified by:
createFolder in interface IRemoteFileSubSystem
Parameters:
folderToCreate - The object representing the folder to be created.
monitor - the progress monitor
Returns:
The same input object returned for convenience. Will throw exception if it fails.
Throws:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.
See Also:
IRemoteFileSubSystem.createFolders(IRemoteFile, IProgressMonitor)

createFolders

public IRemoteFile createFolders(IRemoteFile folderToCreate,
                                 IProgressMonitor monitor)
                          throws SystemMessageException
Description copied from interface: IRemoteFileSubSystem
Given an IRemoteFile for a folder, this will create that folder and any missing parent folders in its path. Use getParentFolder to get the parent object of your file or folder in order to call this method.

Specified by:
createFolders in interface IRemoteFileSubSystem
Parameters:
folderToCreate - The object representing the folder to be created, along with its parents.
monitor - the progress monitor
Returns:
The same input object returned for convenience. Will throw exception if it fails.
Throws:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.
See Also:
IRemoteFileSubSystem.getParentFolder(IRemoteFile, IProgressMonitor)

delete

public boolean delete(IRemoteFile folderOrFile,
                      IProgressMonitor monitor)
               throws SystemMessageException
Description copied from interface: IRemoteFileSubSystem
Delete the given remote file or folder.

Specified by:
delete in interface IRemoteFileSubSystem
Parameters:
folderOrFile - represents the object to be deleted.
monitor - progressMonitor
Returns:
false if the given folder/file didn't exist to begin with, else true. Throws an exception if anything fails.
Throws:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.

deleteBatch

public boolean deleteBatch(IRemoteFile[] folderOrFiles,
                           IProgressMonitor monitor)
                    throws SystemMessageException
Description copied from interface: IRemoteFileSubSystem
Delete the given batch of remote file or folder. Should throw an exception if some files and folders were deleted and others were not due to an exception during the operation. Without an exception thrown in such cases, views may not be refreshed correctly to account for deleted resources.

Specified by:
deleteBatch in interface IRemoteFileSubSystem
Parameters:
folderOrFiles - represents the objects to be deleted.
monitor - progressMonitor
Returns:
false if any of the given folder/file dont exist to begin with, else true. Throws an exception if anything fails.
Throws:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.

rename

public boolean rename(IRemoteFile folderOrFile,
                      String newName,
                      IProgressMonitor monitor)
               throws SystemMessageException
Description copied from interface: IRemoteFileSubSystem
Rename the given remote file or folder. This renames it in memory and, iff it exists, on disk.

Specified by:
rename in interface IRemoteFileSubSystem
Parameters:
folderOrFile - represents the object to be renamed.
newName - new name to give it.
monitor - the progress monitor
Returns:
false if the given folder/file didn't exist on disk (still renamed in memory), else true. Throws an exception if anything fails.
Throws:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.

move

public boolean move(IRemoteFile sourceFolderOrFile,
                    IRemoteFile targetFolder,
                    String newName,
                    IProgressMonitor monitor)
             throws SystemMessageException
Description copied from interface: IRemoteFileSubSystem
Move a file or folder to a new target parent folder.

Specified by:
move in interface IRemoteFileSubSystem
Parameters:
sourceFolderOrFile - The file or folder to move
targetFolder - The folder to move to. No guarantee it is on the same system, so be sure to check getSystemConnection()!
newName - The new name for the moved file or folder
monitor - progress monitor
Returns:
true if the move succeeded
Throws:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.

setLastModified

public boolean setLastModified(IRemoteFile folderOrFile,
                               long newDate,
                               IProgressMonitor monitor)
                        throws SystemMessageException
Description copied from interface: IRemoteFileSubSystem
Set the last modified date for the given file or folder. Like a Unix "touch" operation. Folder or file must exist on disk for this to succeed.

Specified by:
setLastModified in interface IRemoteFileSubSystem
Parameters:
folderOrFile - represents the object to be renamed.
newDate - new date, in milliseconds from epoch, to assign.
monitor - the progress monitor
Returns:
false if the given folder/file didn't exist on disk (operation fails), else true. Throws an exception if anything fails.
Throws:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.

setReadOnly

public boolean setReadOnly(IRemoteFile folderOrFile,
                           boolean readOnly,
                           IProgressMonitor monitor)
                    throws SystemMessageException
Description copied from interface: IRemoteFileSubSystem
Set a files read-only permissions. Folder or file must exist on disk for this to succeed.

Specified by:
setReadOnly in interface IRemoteFileSubSystem
Parameters:
folderOrFile - represents the object to be renamed.
readOnly - whether to set it to be read-only or not
monitor - the progress monitor
Returns:
false if the given folder/file didn't exist on disk (operation fails), else true. Throws an exception if anything fails.
Throws:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.

getLanguageUtilityFactory

public ILanguageUtilityFactory getLanguageUtilityFactory()
Description copied from interface: IRemoteFileSubSystem
Returns a language utility factory associated with this subsystem.

Specified by:
getLanguageUtilityFactory in interface IRemoteFileSubSystem
Returns:
the language utility factory associated with this subsystem.

setLanguageUtilityFactory

public void setLanguageUtilityFactory(ILanguageUtilityFactory factory)

search

public void search(IHostSearchResultConfiguration searchConfig)
Description copied from interface: IRemoteFileSubSystem
Given a search configuration, searches for its results.

Specified by:
search in interface IRemoteFileSubSystem
Parameters:
searchConfig - a search configuration.

cancelSearch

public void cancelSearch(IHostSearchResultConfiguration searchConfig)
Description copied from interface: IRemoteFileSubSystem
Given a search configuration, cancel the search.

Specified by:
cancelSearch in interface IRemoteFileSubSystem
Overrides:
cancelSearch in class RemoteFileSubSystem
Parameters:
searchConfig - a search configuration.

createSearchConfiguration

public IHostSearchResultConfiguration createSearchConfiguration(IHostSearchResultSet resultSet,
                                                                Object searchTarget,
                                                                SystemSearchString searchString)
Specified by:
createSearchConfiguration in interface IFileServiceSubSystem

switchServiceFactory

public void switchServiceFactory(IServiceSubSystemConfiguration fact)
Switch to use another protocol

Specified by:
switchServiceFactory in interface IServiceSubSystem

getServiceType

public Class getServiceType()
Specified by:
getServiceType in interface IServiceSubSystem

initializeSubSystem

public void initializeSubSystem(IProgressMonitor monitor)
Description copied from class: SubSystem
Initialize this subsystem instance after the corresponding IConnectorService connect method finishes. This method should be overridden if any initialization for the subsystem needs to occur at this time

The default implementation currently does nothing, but overriding methods should call super.

Specified by:
initializeSubSystem in interface ISubSystem
Overrides:
initializeSubSystem in class RemoteFileSubSystem
Parameters:
monitor - a monitor that can be used to show progress or provide cancellation.

uninitializeSubSystem

public void uninitializeSubSystem(IProgressMonitor monitor)
Description copied from class: SubSystem
Uninitialize this subsystem just after disconnect. The default implementation currently does nothing. Overriding methods should call super.

Specified by:
uninitializeSubSystem in interface ISubSystem
Overrides:
uninitializeSubSystem in class RemoteFileSubSystem
Parameters:
monitor - a progress monitor that can be used to show uninitialization progress can provide cancellation.

getRemoteEncoding

public String getRemoteEncoding()
Returns the encoding from the file service being used by this subsystem.

Specified by:
getRemoteEncoding in interface IRemoteFileSubSystem
Overrides:
getRemoteEncoding in class RemoteFileSubSystem
Returns:
the encoding of the remote system.
See Also:
RemoteFileSubSystem.getRemoteEncoding()

getInputStream

public InputStream getInputStream(String remoteParent,
                                  String remoteFile,
                                  boolean isBinary,
                                  IProgressMonitor monitor)
                           throws SystemMessageException
Defers to the file service.

Specified by:
getInputStream in interface IRemoteFileSubSystem
Parameters:
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.
Returns:
the input stream to access the contents of the remote file.
Throws:
SystemMessageException - if an error occurs.
See Also:
IRemoteFileSubSystem.getInputStream(java.lang.String, java.lang.String, boolean, org.eclipse.core.runtime.IProgressMonitor)

getOutputStream

public OutputStream getOutputStream(String remoteParent,
                                    String remoteFile,
                                    boolean isBinary,
                                    IProgressMonitor monitor)
                             throws SystemMessageException
Defers to the file service.

Specified by:
getOutputStream in interface IRemoteFileSubSystem
Parameters:
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.
Returns:
the input stream to access the contents of the remote file.
Throws:
SystemMessageException - if an error occurs.
See Also:
IRemoteFileSubSystem.getOutputStream(java.lang.String, java.lang.String, boolean, org.eclipse.core.runtime.IProgressMonitor)

RSE
Release 2.0

Copyright (c) IBM Corporation and others 2000, 2007. All Rights Reserved.