RSE
Release 1.0

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

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

public final class FileServiceSubSystem
extends RemoteFileSubSystem
implements IFileServiceSubSystem


Nested Class Summary
 
Nested classes 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  org.eclipse.rse.internal.subsystems.files.core.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, HOME_FOLDER_EDEFAULT, homeFolder, matcher, monitor, 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 class org.eclipse.rse.core.model.RSEModelObject
_isDirty, _wasRestored
 
Fields inherited from interface org.eclipse.rse.model.ISystemResourceChangeEvents
EVENT_ADD, EVENT_ADD_FILTER_REFERENCE, EVENT_ADD_FILTERSTRING_REFERENCE, EVENT_ADD_MANY, EVENT_ADD_RELATIVE, EVENT_CHANGE_CHILDREN, EVENT_CHANGE_FILTER_REFERENCE, EVENT_CHANGE_FILTERSTRING_REFERENCE, EVENT_COLLAPSE_ALL, EVENT_COLLAPSE_SELECTED, EVENT_COMMAND_FINISHED, EVENT_COMMAND_HISTORY_UPDATE, EVENT_COMMAND_MESSAGE, EVENT_COMMAND_RUN, EVENT_COMMAND_SHELL_FINISHED, EVENT_COMMAND_SHELL_REMOVED, EVENT_COMPILE_COMMAND_RUN, EVENT_DELETE, EVENT_DELETE_FILTER_REFERENCE, EVENT_DELETE_FILTERSTRING_REFERENCE, EVENT_DELETE_MANY, EVENT_EXPAND_SELECTED, EVENT_ICON_CHANGE, EVENT_MOVE_FILTER_REFERENCES, EVENT_MOVE_FILTERSTRING_REFERENCES, EVENT_MOVE_MANY, EVENT_MUST_COLLAPSE, EVENT_PROPERTY_CHANGE, EVENT_PROPERTYSHEET_UPDATE, EVENT_REFRESH, EVENT_REFRESH_REMOTE, EVENT_REFRESH_SELECTED, EVENT_REFRESH_SELECTED_FILTER, EVENT_REFRESH_SELECTED_PARENT, EVENT_RENAME, EVENT_RENAME_FILTER_REFERENCE, EVENT_REPLACE_CHILDREN, EVENT_REVEAL_AND_SELECT, EVENT_SEARCH_FINISHED, EVENT_SELECT, EVENT_SELECT_EXPAND, EVENT_SELECT_REMOTE, PROPERTYSHEET_UPDATE_EVENT
 
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)
          Create a new file, given its IRemoteFile object (these do not have to represent existing files).
 IRemoteFile createFolder(IRemoteFile folderToCreate)
          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)
          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(IProgressMonitor monitor, String parentPath, String fileName)
           
protected  IHostFile[] getFiles(IProgressMonitor monitor, String parentPath, String fileNameFilter)
           
protected  IHostFile[] getFilesAndFolders(IProgressMonitor monitor, String parentPath, String fileNameFilter)
           
 IFileService getFileService()
          Returns the file service used by this subsystem.
protected  IHostFile[] getFolders(IProgressMonitor monitor, String parentPath, String fileNameFilter)
           
 IHostFileToRemoteFileAdapter getHostFileToRemoteFileAdapter()
           
 org.eclipse.rse.internal.subsystems.files.core.ILanguageUtilityFactory getLanguageUtilityFactory()
          Returns a language utility factory associated with this subsystem.
 IRemoteFile getParentFolder(IRemoteFile folderOrFile)
          Given a folder or file, return its parent folder object.
 String getRemoteEncoding()
          Get the default encoding of the target system
 IRemoteFile getRemoteFileObject(IRemoteFile parent, String folderOrFileName)
          Constructs an IRemoteFile object given an unqualified file or folder name and its parent folder object.
 IRemoteFile getRemoteFileObject(String folderOrFileName)
          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)
          Called on each subsystem associated with a particular IConnectorService after it connects.
protected  boolean isBinary(IRemoteFile source)
           
protected  boolean isBinary(String localEncoding, String hostEncoding, String remotePath)
           
 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)
          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(org.eclipse.rse.internal.subsystems.files.core.ILanguageUtilityFactory factory)
           
 boolean setLastModified(IRemoteFile folderOrFile, long newDate)
          Set the last modified date for the given file or folder.
 boolean setReadOnly(IRemoteFile folderOrFile)
          Set a file to readonly.
 void setSearchService(ISearchService service)
           
 void switchServiceFactory(IServiceSubSystemConfiguration fact)
          Switch to use another protocol
 void uninitializeSubSystem(IProgressMonitor monitor)
          Called on each subsystem associated with a particular IConnectorService after it disconnects
 void upload(InputStream stream, long totalBytes, IRemoteFile destination, String encoding, IProgressMonitor monitor)
          Put local data to a remote location.
 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, checkForCancel, communicationsStateChange, doesFilterMatch, doesFilterStringListContentsOf, doesFilterStringMatch, download, download, download, download, download, downloadUTF8, downloadUTF8, downloadUTF8, getCachedRemoteFile, getContext, getContext, getCurrentFilterString, getDefaultContext, getDefaultContextNoFilterString, getFilterStringListRoots, getFirstParentFilterString, getHomeFolder, getLineSeparator, getLocalAddress, getObjectWithAbsoluteName, getParentFolderName, getParentRemoteFileSubSystemConfiguration, getPathSeparator, getPathSeparatorChar, getPropertyPage, getRemoteFileObjects, getRemoteSearchResultObject, getSeparator, getSeparatorChar, getTargetForFilter, getUnusedPort, internalResolveFilterString, internalResolveFilterString, internalResolveFilterStrings, internalResolveOneFilterString, isCaseSensitive, isPassiveCommunicationsListener, isPrimarySubSystem, listFiles, listFiles, listFolders, listFolders, listFoldersAndFiles, listFoldersAndFiles, listRoots, removeCachedRemoteFile, removeCachedRemoteFile, runLocalCommand, setHomeFolder, setListValues, setListValues, sortResolvedFilterStringObjects, toString, upload, upload, upload, upload, upload, upload, uploadUTF8, uploadUTF8, uploadUTF8
 
Methods inherited from class org.eclipse.rse.core.subsystems.SubSystem
checkIsConnected, clearLocalUserId, commit, 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, getPreferencesKey, getPreferencesKey, getPreferencesManager, getPrimarySubSystem, getProperties, getProperty, getQueryingMessage, getQueryingMessage, getRemoteAttribute, getResolvingMessage, getRunnableContext, getRunningMessage, getSettingMessage, getSettingMessage, getShell, getSubSystemConfiguration, getSystemFilterPoolReferenceManager, getSystemProfile, getSystemProfileName, getSystemType, getTargetsForFilter, getUniqueOwningSystemFilterPool, getUserId, getVendorAttribute, hasChildren, implicitConnect, internalConnect, internalDisconnect, internalGetProperties, internalGetProperty, internalSetProperties, internalSetProperty, isConflicting, isConnected, isConnectionError, isHidden, isOffline, promptForPassword, promptForPassword, renamingConnection, renamingProfile, resolveFilterString, resolveFilterString, resolveFilterString, resolveFilterString, resolveFilterStrings, 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
compareStrings, getDescription, isDirty, setDirty, setWasRestored, wasRestored
 
Methods inherited from class org.eclipse.rse.core.model.PropertySetContainer
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem
download, download, download, download, download, downloadUTF8, downloadUTF8, downloadUTF8, getHomeFolder, getLineSeparator, getLocalAddress, getParentFolderName, getParentRemoteFileSubSystemConfiguration, getPathSeparator, getPathSeparatorChar, getRemoteFileObjects, getRemoteSearchResultObject, getSeparator, getSeparatorChar, getUnusedPort, isCaseSensitive, listFiles, listFiles, listFolders, listFolders, listFoldersAndFiles, listFoldersAndFiles, listRoots, setHomeFolder, upload, upload, upload, upload, upload, upload, uploadUTF8, uploadUTF8, uploadUTF8
 
Methods inherited from interface org.eclipse.rse.core.subsystems.ISubSystem
checkIsConnected, clearLocalUserId, 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, resolveFilterString, resolveFilterString, resolveFilterStrings, 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.persistance.IRSEPersistableContainer
commit, isDirty, setDirty, setWasRestored, wasRestored
 

Field Detail

_languageUtilityFactory

protected org.eclipse.rse.internal.subsystems.files.core.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

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

getRemoteEncoding

public String getRemoteEncoding()
Description copied from interface: IRemoteFileSubSystem
Get the default encoding of the target system

Specified by:
getRemoteEncoding in interface IRemoteFileSubSystem
Returns:
the encoding

setHostFileToRemoteFileAdapter

public void setHostFileToRemoteFileAdapter(IHostFileToRemoteFileAdapter hostFileAdapter)

getRemoteFileObject

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

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

getRemoteFileObject

public IRemoteFile getRemoteFileObject(String folderOrFileName)
                                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
Returns:
The constructed IRemoteFile
Throws:
SystemMessageException
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(IProgressMonitor monitor,
                                 String parentPath,
                                 String fileNameFilter)
                          throws SystemMessageException
Throws:
SystemMessageException

getFiles

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

getFilesAndFolders

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

getFile

protected IHostFile getFile(IProgressMonitor monitor,
                            String parentPath,
                            String fileName)
                     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)
Get the remote file and save it locally. The file is saved in the encoding specified.

Specified by:
download in interface IRemoteFileSubSystem
Parameters:
encoding - the encoding of the local file
monitor - progress monitor
file - remote file that represents the file to be obtained
localpath - the absolute path of the local file

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 RemoteFileSecurityException,
                   RemoteFileIOException
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

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:
RemoteFileSecurityException
RemoteFileIOException

upload

public void upload(String source,
                   IRemoteFile destination,
                   String encoding,
                   IProgressMonitor monitor)
            throws RemoteFileSecurityException,
                   RemoteFileIOException
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

Specified by:
upload in interface IRemoteFileSubSystem
Parameters:
source - the absolute path of the local copy
destination - location to copy to
encoding - The encoding of the local copy
monitor - progress monitor
Throws:
RemoteFileSecurityException
RemoteFileIOException

upload

public void upload(InputStream stream,
                   long totalBytes,
                   IRemoteFile destination,
                   String encoding,
                   IProgressMonitor monitor)
            throws RemoteFileSecurityException,
                   RemoteFileIOException
Description copied from interface: IRemoteFileSubSystem
Put local data to a remote location. The local data is assumed to be in the encoding specified.

Specified by:
upload in interface IRemoteFileSubSystem
Parameters:
stream - the input stream containing the local data.
totalBytes - the total number of bytes in the stream, or -1 if unknown. If -1 is specified, then the progress monitor must be null.
destination - remote file that represents the file on the server.
encoding - the encoding of the local data, or null to specify binary.
monitor - the progress monitor.
Throws:
RemoteFileSecurityException
RemoteFileIOException

copy

public boolean copy(IRemoteFile sourceFolderOrFile,
                    IRemoteFile targetFolder,
                    String newName,
                    IProgressMonitor monitor)
             throws RemoteFileSecurityException,
                    RemoteFileIOException
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
Returns:
false true iff the copy succeeded
Throws:
RemoteFileSecurityException
RemoteFileIOException

copyBatch

public boolean copyBatch(IRemoteFile[] sourceFolderOrFiles,
                         IRemoteFile targetFolder,
                         IProgressMonitor monitor)
                  throws RemoteFileSecurityException,
                         RemoteFileIOException
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:
targetFolder - The folder to copy to.
Returns:
false true iff all copies succeeded
Throws:
RemoteFileSecurityException
RemoteFileIOException

getParentFolder

public IRemoteFile getParentFolder(IRemoteFile folderOrFile)
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.

createFile

public IRemoteFile createFile(IRemoteFile fileToCreate)
                       throws RemoteFileSecurityException,
                              RemoteFileIOException
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:
RemoteFileSecurityException
RemoteFileIOException
See Also:
IRemoteFileSubSystem.createFolders(IRemoteFile)

createFolder

public IRemoteFile createFolder(IRemoteFile folderToCreate)
                         throws RemoteFileSecurityException,
                                RemoteFileIOException
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.
Returns:
The same input object returned for convenience. Will throw exception if it fails.
Throws:
RemoteFileSecurityException
RemoteFileIOException
See Also:
IRemoteFileSubSystem.createFolders(IRemoteFile)

createFolders

public IRemoteFile createFolders(IRemoteFile folderToCreate)
                          throws RemoteFileSecurityException,
                                 RemoteFileIOException
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.
Returns:
The same input object returned for convenience. Will throw exception if it fails.
Throws:
RemoteFileSecurityException
RemoteFileIOException
See Also:
IRemoteFileSubSystem.getParentFolder(IRemoteFile)

delete

public boolean delete(IRemoteFile folderOrFile,
                      IProgressMonitor monitor)
               throws RemoteFolderNotEmptyException,
                      RemoteFileSecurityException,
                      RemoteFileIOException
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:
RemoteFolderNotEmptyException
RemoteFileSecurityException
RemoteFileIOException

deleteBatch

public boolean deleteBatch(IRemoteFile[] folderOrFiles,
                           IProgressMonitor monitor)
                    throws RemoteFolderNotEmptyException,
                           RemoteFileSecurityException,
                           RemoteFileIOException
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:
RemoteFolderNotEmptyException
RemoteFileSecurityException
RemoteFileIOException

rename

public boolean rename(IRemoteFile folderOrFile,
                      String newName)
               throws RemoteFileSecurityException,
                      RemoteFileIOException
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.
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:
RemoteFileSecurityException
RemoteFileIOException

move

public boolean move(IRemoteFile sourceFolderOrFile,
                    IRemoteFile targetFolder,
                    String newName,
                    IProgressMonitor monitor)
             throws RemoteFileSecurityException,
                    RemoteFileIOException
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:
false true iff the move succeeded
Throws:
RemoteFileSecurityException
RemoteFileIOException

setLastModified

public boolean setLastModified(IRemoteFile folderOrFile,
                               long newDate)
                        throws RemoteFileSecurityException,
                               RemoteFileIOException
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.
Returns:
false if the given folder/file didn't exist on disk (operation fails), else true. Throws an exception if anything fails.
Throws:
RemoteFileSecurityException
RemoteFileIOException

setReadOnly

public boolean setReadOnly(IRemoteFile folderOrFile)
                    throws RemoteFileSecurityException,
                           RemoteFileIOException
Description copied from interface: IRemoteFileSubSystem
Set a file to readonly. 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.
Returns:
false if the given folder/file didn't exist on disk (operation fails), else true. Throws an exception if anything fails.
Throws:
RemoteFileSecurityException
RemoteFileIOException

getLanguageUtilityFactory

public org.eclipse.rse.internal.subsystems.files.core.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(org.eclipse.rse.internal.subsystems.files.core.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

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 interface: ISubSystem
Called on each subsystem associated with a particular IConnectorService after it connects.

Specified by:
initializeSubSystem in interface ISubSystem
Overrides:
initializeSubSystem in class RemoteFileSubSystem

uninitializeSubSystem

public void uninitializeSubSystem(IProgressMonitor monitor)
Description copied from interface: ISubSystem
Called on each subsystem associated with a particular IConnectorService after it disconnects

Specified by:
uninitializeSubSystem in interface ISubSystem
Overrides:
uninitializeSubSystem in class RemoteFileSubSystem

RSE
Release 1.0

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