Remote Systems
v6.4.1

com.ibm.etools.systems.subsystems.impl
Class RemoteFileSubSystemImpl

java.lang.Object
  extended byEObjectImpl
      extended bycom.ibm.etools.systems.subsystems.impl.SubSystemImpl
          extended bycom.ibm.etools.systems.subsystems.impl.RemoteFileSubSystemImpl
All Implemented Interfaces:
IAdaptable, ICommunicationsListener, IRemoteObjectResolver, ISystemResourceChangeEvents, RemoteFileSubSystem, SubSystem, SystemFilterPoolReferenceManagerProvider
Direct Known Subclasses:
DefaultFileSubSystemImpl, LocalFileSubSystemImpl, UniversalFileSubSystemImpl

public abstract class RemoteFileSubSystemImpl
extends SubSystemImpl
implements RemoteFileSubSystem, ICommunicationsListener

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.ibm.etools.systems.subsystems.impl.SubSystemImpl
SubSystemImpl.ConnectRunnable, SubSystemImpl.DisplayErrorMessageRunnable
 
Field Summary
protected  HashMap _cachedRemoteFiles
           
protected  ArrayList _searchHistory
           
static String copyright
           
protected  RemoteFileFilterString currFilterString
           
protected  RemoteFileContext DEFAULT_CONTEXT
           
protected  RemoteFileContext DEFAULT_CONTEXT_NOFILTERSTRING
           
protected  RemoteFileFilterString FILTERSTRING_LISTROOTS
           
protected  NamePatternMatcher folderNameMatcher
           
protected static String HOME_FOLDER_EDEFAULT
          The default value of the 'Home Folder' attribute
protected  String homeFolder
           
protected  IMatcher matcher
           
 String osCmdShell
           
 String osName
           
 boolean osVarsSet
           
 boolean osWindows
           
 boolean osWindows95
           
 boolean osWindowsNT
           
 
Fields inherited from class com.ibm.etools.systems.subsystems.impl.SubSystemImpl
_connectionError, _disconnecting, _system, ADDITIONAL_ATTRIBUTES_EDEFAULT, additionalAttributes, additionalAttributesESet, cancelable, DELIM_VENDOR_ATTR_VALUE, DELIM_VENDOR_ATTRS, DELIM_VENDOR_NAME, doConnection, FACTORY_ID_EDEFAULT, factoryId, filterPoolReferenceManager, hidden, HIDDEN_EDEFAULT, IBM_ATTRIBUTES_EDEFAULT, ibmAttributes, ibmAttributesESet, ibmAttrs, monitor, name, NAME_EDEFAULT, operation, 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, parentConnection, parentSubSystemFactory, pmDialog, port, PORT_EDEFAULT, previousUserIdKey, remoteServerLauncher, runContext, runException, runInput, runInput2, runInputs, runInputs2, runInterpret, runInThread, runObject, runOutput, runOutputs, runOutputString, runOutputStrings, saveFileName, shell, sortResults, SUBSYSTEM_FILE_NAME, supportsConnecting, USE_SSL_EDEFAULT, USER_ID_EDEFAULT, userId, useSSL, VENDOR_ATTRIBUTES_EDEFAULT, vendorAttributes, vendorAttributesESet, vendorAttrs
 
Fields inherited from interface com.ibm.etools.systems.subsystems.IRemoteObjectResolver
Copyright
 
Fields inherited from interface com.ibm.etools.systems.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
RemoteFileSubSystemImpl()
          Default constructor.
 
Method Summary
protected  boolean accept(String name, boolean isFile)
          Method to decide if a given folder or file name matches the present criteria.
protected  void addResolvedFilterStringObjects(Vector allChildrenSoFar, Object[] childrenForThisFilterString, String[] allFilterStrings, int currFilterStringIndex)
          Overridable parent extension point for adding the results of a filter string to the overall list of results.
 void cacheRemoteFile(IRemoteFile file)
          Store the IRemoteFile in a hashmap to quick subsequent retrieval
 void cacheRemoteFile(IRemoteFile file, String path)
          Store the IRemoteFile in a hashmap to quick subsequent retrieval
 boolean checkForCancel()
          Long running list processing calls this method to check for a user-cancel event.
 void communicationsStateChange(CommunicationsEvent e)
          This method is invoked whenever the communications state is invoked immediately before and after the state of the communications changes.
 void copy(File source, IRemoteFile destination, IProgressMonitor monitor)
          Put the local copy of the remote file back to the remote location.
 void copy(File source, IRemoteFile destination, String encoding, IProgressMonitor monitor)
          Put the local copy of the remote file back to the remote location.
 void copy(IRemoteFile source, File destination, IProgressMonitor monitor)
          Get the remote file and save it locally.
 void copy(IRemoteFile source, File destination, String encoding, IProgressMonitor monitor)
          Get the remote file and save it locally.
 void copy(IRemoteFile source, String destination, IProgressMonitor monitor)
          Get the remote file and save it locally.
 void copy(String source, IRemoteFile destination, IProgressMonitor monitor)
          Put the local copy of the remote file back to the remote location.
 void copyLocalToRemote(String source, String destination, IProgressMonitor monitor)
          Put the local copy of the remote file back to the remote location.
 void copyLocalToRemote(String source, String srcEncoding, String remotePath, String rmtEncoding, IProgressMonitor monitor)
          Put the local copy of the remote file back to the remote location.
 void copyUTF8(File source, IRemoteFile destination, IProgressMonitor monitor)
          Put the local copy of the remote file back to the remote location.
 void copyUTF8(IRemoteFile source, File destination, IProgressMonitor monitor)
          Get the remote file and save it locally.
 void copyUTF8(IRemoteFile source, String destination, IProgressMonitor monitor)
          Get the remote file and save it locally.
 void copyUTF8(String source, IRemoteFile destination, IProgressMonitor monitor)
          Put the local copy of the remote file back to the remote location.
 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.
 boolean delete(IRemoteFile folderOrFile)
          Delete the given remote file or folder.
 boolean doesFilterStringListContentsOf(SystemFilterString filterString, String remoteObjectAbsoluteName)
          Return true if the given filter string lists the contents of the given remote object.
 boolean doesFilterStringMatch(String filterString, String remoteObjectAbsoluteName, boolean caseSensitive)
          Return true if the given remote object name will pass the filtering criteria for the given filter string.
 Object eGet(EStructuralFeature eFeature, boolean resolve)
           
 NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs)
           
 NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs)
           
 boolean eIsSet(EStructuralFeature eFeature)
          Private.
 void eSet(EStructuralFeature eFeature, Object newValue)
          Private.
protected  EClass eStaticClass()
           
 void eUnset(EStructuralFeature eFeature)
          Private.
 IRemoteFile getCachedRemoteFile(String path)
          Returns the cached remote file with the specified path.
protected  RemoteFileContext getContext(IRemoteFile parent)
           
protected  RemoteFileContext getContext(IRemoteFile parent, RemoteFileFilterString rffs)
           
protected  RemoteFileFilterString getCurrentFilterString()
           
protected  RemoteFileContext getDefaultContext()
           
protected  RemoteFileContext getDefaultContextNoFilterString()
           
protected  RemoteFileFilterString getFilterStringListRoots()
           
protected  String getFirstParentFilterString(Object parent)
          Called by parent when we defer getting a filter string until later, where we query it from the parent.
 String getHomeFolder()
           
 ILanguageUtilityFactory getLanguageUtilityFactory()
          Returns null.
 String getLineSeparator()
          Return as a string the line separator.
 InetAddress getLocalAddress()
          Returns the address found by calling InetAddress.getLocalHost().
 Object getObjectWithAbsoluteName(String key)
          Return the object within the subsystem that corresponds to the specified unique ID.
 IRemoteFile getParentFolder(IRemoteFile folderOrFile)
          Given a folder or file, return its parent folder object.
 String getParentFolderName(IRemoteFile folderOrFile)
          Given a folder or file, return its parent folder name, fully qualified
 RemoteFileSubSystemFactory getParentRemoteFileSubSystemFactory()
          Return parent subsystem factory, cast to a RemoteFileSubSystemFactory Assumes SubSystemImpl.setParentSubSystemFactory(SubSystemFactory) has already been called.
 String getPathSeparator()
          Return in string format the character used to separate paths.
 char getPathSeparatorChar()
          Return in char format the character used to separate paths.
 PropertyPage getPropertyPage(Composite parent)
          Return the single property page to show in the tabbed notebook for the for SubSystem property of the parent Connection.
 IRemoteFile getRemoteFileObject(IRemoteFile parent, String folderOrFileName)
          Given a un-qualified file or folder name, and its parent folder object, return an IRemoteFile object for the file.
 IRemoteFile getRemoteFileObject(String folderOrFileName)
          Given a fully qualified file or folder name, return an IRemoteFile object for it.
 IRemoteSearchResult getRemoteSearchResultObject(String key)
          Given a key, returns a search result object for it.
 String getSeparator()
          Return in string format the character used to separate folders.
 char getSeparatorChar()
          Return in character format the character used to separate folders.
 Object getTargetForFilter(SystemFilterReference filterRef)
          Returns the parent object associated with a filter reference.
 int getUnusedPort()
          Returns -1 by default.
protected  Object[] internalResolveFilterString(IProgressMonitor monitor, Object parent, String filterString)
          Actually resolve a relative filter string.
protected  Object[] internalResolveFilterString(IProgressMonitor monitor, String filterString)
          Actually resolve an absolute filter string.
 Object[] internalResolveFilterStrings(IProgressMonitor monitor, String[] filterStrings)
          Resolves filter strings.
protected  Object[] internalResolveOneFilterString(IProgressMonitor monitor, Object parent, RemoteFileFilterString fs, boolean sort)
          Do one filter string relative resolve
 boolean isCaseSensitive()
          Return true if file names are case-sensitive.
 boolean isPassiveCommunicationsListener()
          This method determines if the communications listener is a passive or active listener.
 IRemoteFile[] listFiles(IRemoteFile parent)
          Return a list of all remote files in the given parent folder on the remote system
 IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter)
          Return a list of remote files in the given folder, which match the given name pattern.
 IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context)
          Return a list of remote files in the given folder, which match the given name pattern.
 IRemoteFile[] listFolders(IRemoteFile parent)
          Return a list of all remote folders in the given parent folder on the remote system
 IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter)
          Return a full list of remote folders in the given parent folder on the remote system.
 IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context)
          Return a subsetted list of remote folders in the given parent folder on the remote system.
 IRemoteFile[] listFoldersAndFiles(IRemoteFile parent)
          Return a list of all remote folders and files in the given folder.
 IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter)
          Return a list of remote folders and files in the given folder.
 IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context)
          Return a list of remote folders and files in the given folder.
 IRemoteFile[] listRoots()
          Return a list of roots/drives on the remote system
 IRemoteFile[] listRoots(IRemoteFileContext context)
          Return a list of roots/drives on the remote system.
 boolean move(IRemoteFile sourceFolderOrFile, IRemoteFile targetFolder, String newName)
          Move a file or folder to a new target parent folder.
protected  void removeCachedRemoteFile(IRemoteFile file)
           
protected  void removeCachedRemoteFile(String path)
           
 boolean rename(IRemoteFile folderOrFile, String newName)
          Rename the given remote file or folder.
 void runLocalCommand(String cmd)
           
static int runLocalCommand(String cmd, Vector lines)
          helper method to run an external command
 void setHomeFolder(String newHomeFolder)
           
 boolean setLastModified(IRemoteFile folderOrFile, long newDate)
          Set the last modified date for the given file or folder.
protected  void setListValues(int includeFilesOrFolders, String nameFilter)
          Method to set variables to affect the folder content subsetting.
protected  void setListValues(int includeFilesOrFolders, String folderNameFilter, String fileNameFilter)
          Overloaded method to set variables to affect the folder content subsetting, when there is separate filters for both folder names and filter names.
 boolean setReadOnly(IRemoteFile folderOrFile)
          Set a file to readonly.
 Object[] sortResolvedFilterStringObjects(Object[] children)
          Sort the concatenated list of all objects returned by resolving one or more filter strings.
 String toString()
           
 
Methods inherited from class com.ibm.etools.systems.subsystems.impl.SubSystemImpl
basicSetFilterPoolReferenceManager, basicSetRemoteServerLauncher, cancelShell, checkIsConnected, clearLocalUserId, connect, connect, connect, deletingConnection, disconnect, disconnect, displayAsyncMsg, doesFilterListContentsOf, doesFilterMatch, doesFilterTypeMatch, filterEventFilterCreated, filterEventFilterPoolReferenceCreated, filterEventFilterPoolReferenceDeleted, filterEventFilterPoolReferenceRenamed, filterEventFilterPoolReferenceReset, filterEventFilterPoolReferencesRePositioned, filterEventFilterPoolReferencesReset, filterEventFilterStringCreated, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, forceUserIdToUpperCase, getActiveWorkbenchShell, getActiveWorkbenchWindow, getAdapter, getAdditionalAttributes, getCacheManager, getChildren, getCommandSubSystem, getConnectionOwnedFilterPoolName, getConnectionPrivateFilterPool, getExecutedCommands, getFactoryId, getFilterPoolReferenceManager, getFilterReferenceWithAbsoluteName, getHostName, getIBMAttribute, getIbmAttributes, getLocalUserId, getLocalUserId, getName, getParentSubSystemFactory, getPort, getPortAsInt, getPreferencesKey, getPreferencesKey, getPreferencesManager, getPrimarySubSystem, getProperties, getProperty, getQueryingMessage, getQueryingMessage, getRemoteServerLauncher, getResolvingMessage, getRunnableContext, getRunningMessage, getSaveFileName, getSettingMessage, getSettingMessage, getShell, getSystem, getSystemConnection, getSystemConnectionName, getSystemFilterPoolReferenceManager, getSystemManager, getSystemProfile, getSystemProfileName, getSystemType, getUDActionSubsystem, getUniqueOwningSystemFilterPool, getUserId, getUserIdGen, getVendorAttribute, getVendorAttributes, hasChildren, internalCancelShell, internalConnect, internalDisconnect, internalGetProperties, internalGetProperty, internalRemoveShell, internalRunCommand, internalRunCommand, internalRunShell, internalSendCommandToShell, internalSetProperties, internalSetProperty, isConnected, isConnectionError, isHidden, isOffline, isSetAdditionalAttributes, isSetIbmAttributes, isSetVendorAttributes, isUseSSL, removeShell, renamingConnection, renamingProfile, resolveFilterString, resolveFilterString, resolveFilterString, resolveFilterString, resolveFilterStrings, resolveFilterStrings, run, runCommand, runCommand, runShell, selectCommandSubSystem, sendCommandToShell, setAdditionalAttributes, setConnectionError, setFactoryId, setFilterPoolReferenceManager, setHidden, setIBMAttribute, setIbmAttributes, setName, setParentConnection, setParentSubSystemFactory, setPort, setProperties, setProperty, setRemoteServerLauncher, setSaveFileName, setUserId, setUserIdGen, setUseSSL, setVendorAttribute, setVendorAttributes, showConnectCancelledMessage, showConnectErrorMessage, showDisconnectCancelledMessage, showDisconnectErrorMessage, showOperationCancelledMessage, showOperationErrorMessage, showOperationMessage, supportsCaching, unsetAdditionalAttributes, unsetIbmAttributes, unsetVendorAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.etools.systems.subsystems.RemoteFileSubSystem
cancelSearch, copy, copy, copy, copy, getRemoteEncoding, getRemoteSearchResultConfigurationFactory, search
 
Methods inherited from interface com.ibm.etools.systems.subsystems.SubSystem
checkIsConnected, clearLocalUserId, connect, connect, connect, deletingConnection, disconnect, disconnect, doesFilterListContentsOf, doesFilterMatch, forceUserIdToUpperCase, getAdditionalAttributes, getCacheManager, getChildren, getCommandSubSystem, getFactoryId, getFilterPoolReferenceManager, getIbmAttributes, getLocalUserId, getName, getParentSubSystemFactory, getPort, getPortAsInt, getPrimarySubSystem, getProperties, getProperty, getRemoteServerLauncher, getSaveFileName, getSystem, getSystemConnection, getSystemConnectionName, getSystemFilterPoolReferenceManager, getSystemManager, getSystemProfile, getSystemProfileName, getUDActionSubsystem, getUserId, getVendorAttribute, getVendorAttributes, hasChildren, isConnected, isConnectionError, isHidden, isOffline, isSetAdditionalAttributes, isSetIbmAttributes, isSetVendorAttributes, isUseSSL, renamingConnection, renamingProfile, resolveFilterString, resolveFilterString, resolveFilterString, resolveFilterString, resolveFilterStrings, resolveFilterStrings, setAdditionalAttributes, setConnectionError, setFactoryId, setFilterPoolReferenceManager, setHidden, setIbmAttributes, setName, setParentConnection, setParentSubSystemFactory, setPort, setProperties, setProperty, setRemoteServerLauncher, setSaveFileName, setUserId, setUseSSL, setVendorAttribute, setVendorAttributes, supportsCaching, unsetAdditionalAttributes, unsetIbmAttributes, unsetVendorAttributes
 
Methods inherited from interface com.ibm.etools.systems.filters.SystemFilterPoolReferenceManagerProvider
filterEventFilterCreated, filterEventFilterPoolReferenceCreated, filterEventFilterPoolReferenceDeleted, filterEventFilterPoolReferenceRenamed, filterEventFilterPoolReferenceReset, filterEventFilterPoolReferencesRePositioned, filterEventFilterPoolReferencesReset, filterEventFilterStringCreated, getUniqueOwningSystemFilterPool
 

Field Detail

HOME_FOLDER_EDEFAULT

protected static final String HOME_FOLDER_EDEFAULT
The default value of the 'Home Folder' attribute.

See Also:
getHomeFolder()

copyright

public static final String copyright
See Also:
Constant Field Values

osVarsSet

public boolean osVarsSet

osWindows

public boolean osWindows

osWindows95

public boolean osWindows95

osWindowsNT

public boolean osWindowsNT

osName

public String osName

osCmdShell

public String osCmdShell

matcher

protected IMatcher matcher

folderNameMatcher

protected NamePatternMatcher folderNameMatcher

currFilterString

protected RemoteFileFilterString currFilterString

FILTERSTRING_LISTROOTS

protected RemoteFileFilterString FILTERSTRING_LISTROOTS

DEFAULT_CONTEXT

protected RemoteFileContext DEFAULT_CONTEXT

DEFAULT_CONTEXT_NOFILTERSTRING

protected RemoteFileContext DEFAULT_CONTEXT_NOFILTERSTRING

_searchHistory

protected ArrayList _searchHistory

_cachedRemoteFiles

protected HashMap _cachedRemoteFiles

homeFolder

protected String homeFolder
Constructor Detail

RemoteFileSubSystemImpl

public RemoteFileSubSystemImpl()
Default constructor. Do not call directly! Rather, use the mof generated factory method to create. After instantiation, be sure to call SubSystemImpl.setParentSubSystemFactory(SubSystemFactory).

Method Detail

eStaticClass

protected EClass eStaticClass()

Overrides:
eStaticClass in class SubSystemImpl

getParentRemoteFileSubSystemFactory

public RemoteFileSubSystemFactory getParentRemoteFileSubSystemFactory()
Return parent subsystem factory, cast to a RemoteFileSubSystemFactory Assumes SubSystemImpl.setParentSubSystemFactory(SubSystemFactory) has already been called.

Specified by:
getParentRemoteFileSubSystemFactory in interface RemoteFileSubSystem

isCaseSensitive

public boolean isCaseSensitive()
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 RemoteFileSubSystem

checkForCancel

public boolean checkForCancel()
Long running list processing calls this method to check for a user-cancel event. If user did cancel, an exception is thrown.

Returns:
true if caller wants to cancel

getCurrentFilterString

protected RemoteFileFilterString getCurrentFilterString()

getFilterStringListRoots

protected RemoteFileFilterString getFilterStringListRoots()

getDefaultContext

protected RemoteFileContext getDefaultContext()

getDefaultContextNoFilterString

protected RemoteFileContext getDefaultContextNoFilterString()

getContext

protected RemoteFileContext getContext(IRemoteFile parent)

getContext

protected RemoteFileContext getContext(IRemoteFile parent,
                                       RemoteFileFilterString rffs)

getSeparator

public String getSeparator()
Return in string format the character used to separate folders. Eg, "\" or "/".
Shortcut to getParentRemoteFileSubSystemFactory().getSeparator()

Specified by:
getSeparator in interface RemoteFileSubSystem

getSeparatorChar

public char getSeparatorChar()
Return in character format the character used to separate folders. Eg, "\" or "/"
Shortcut to getParentRemoteFileSubSystemFactory().getSeparatorChar()

Specified by:
getSeparatorChar in interface RemoteFileSubSystem

getPathSeparator

public String getPathSeparator()
Return in string format the character used to separate paths. Eg, ";" or ":"
Shortcut to getParentRemoteFileSubSystemFactory().getPathSeparator()

Specified by:
getPathSeparator in interface RemoteFileSubSystem

getPathSeparatorChar

public char getPathSeparatorChar()
Return in char format the character used to separate paths. Eg, ";" or ":"
Shortcut to getParentRemoteFileSubSystemFactory().getPathSeparatorChar()

Specified by:
getPathSeparatorChar in interface RemoteFileSubSystem

getLineSeparator

public String getLineSeparator()
Return as a string the line separator.
Shortcut to getParentRemoteFileSubSystemFactory().getLineSeparator()

Specified by:
getLineSeparator in interface RemoteFileSubSystem

getPropertyPage

public PropertyPage getPropertyPage(Composite parent)
Return the single property page to show in the tabbed notebook for the for SubSystem property of the parent Connection. Return null if no page is to be contributed for this. You are limited to a single page, so you may have to compress. It is recommended you prompt for the port if applicable since the common base subsystem property page is not shown To help with this you can use the SubSystemPortPrompt widget.

Specified by:
getPropertyPage in interface SubSystem
Overrides:
getPropertyPage in class SubSystemImpl

doesFilterStringMatch

public boolean doesFilterStringMatch(String filterString,
                                     String remoteObjectAbsoluteName,
                                     boolean caseSensitive)
Return true if the given remote object name will pass the filtering criteria for the given filter string.

Subclasses need to override this. If in doubt, return true.

There is a hack here if you want to tell us the absolute name is that of a folder: append " -folder" to the name!

Specified by:
doesFilterStringMatch in interface SubSystem
Overrides:
doesFilterStringMatch in class SubSystemImpl

doesFilterStringListContentsOf

public boolean doesFilterStringListContentsOf(SystemFilterString filterString,
                                              String remoteObjectAbsoluteName)
Return true if the given filter string lists the contents of the given remote object. For example, if given a folder, return true if the given filter string lists the contents of that folder. Used in impact analysis when a remote object is created, deleted, renamed, copied or moved, so as to establish which filters need to be refreshed or collapsed (if the folder is deleted, say).

This should only return true if the filter string directly lists the contents of the given object, versus indirectly.

Subclasses should override this.

Specified by:
doesFilterStringListContentsOf in interface SubSystem
Overrides:
doesFilterStringListContentsOf in class SubSystemImpl

internalResolveFilterStrings

public Object[] internalResolveFilterStrings(IProgressMonitor monitor,
                                             String[] filterStrings)
                                      throws InvocationTargetException,
                                             InterruptedException
Resolves filter strings. The default implementation of this simply calls #internalResolveFilterString(IProgressMontior, String). If the result for each filter string is a SystemMessage (e.g. an error), then the messages are returned. If the result for any filter string is not a message (i.e. an array of children), then the children are returned, and the messages are not. This avoids mixing chuldren as a result of successful resolution of a filter string with messages that might result for other filter strings. So the returned results are always the successful results, or messages (never a mix of the two).

Overrides:
internalResolveFilterStrings in class SubSystemImpl
Parameters:
monitor - the progress monitor we are running under
filterStrings - array of filter patterns for objects to return.
Returns:
Array of objects that are the result of resolving all the filter strings
Throws:
InvocationTargetException
InterruptedException
See Also:
SubSystemImpl.internalResolveFilterStrings(org.eclipse.core.runtime.IProgressMonitor, java.lang.String[])

addResolvedFilterStringObjects

protected void addResolvedFilterStringObjects(Vector allChildrenSoFar,
                                              Object[] childrenForThisFilterString,
                                              String[] allFilterStrings,
                                              int currFilterStringIndex)
Overridable parent extension point for adding the results of a filter string to the overall list of results.

Can be used to filter out redundant entries in the concatenated list, if this is desired.

Overrides:
addResolvedFilterStringObjects in class SubSystemImpl

internalResolveFilterString

protected Object[] internalResolveFilterString(IProgressMonitor monitor,
                                               String filterString)
                                        throws InvocationTargetException,
                                               InterruptedException
Actually resolve an absolute filter string. This is called by the run(IProgressMonitor monitor) method, which in turn is called by resolveFilterString.

Overrides:
internalResolveFilterString in class SubSystemImpl
Throws:
InvocationTargetException
InterruptedException
See Also:
SubSystemImpl.internalResolveFilterString(IProgressMonitor,String)

sortResolvedFilterStringObjects

public Object[] sortResolvedFilterStringObjects(Object[] children)
Sort the concatenated list of all objects returned by resolving one or more filter strings. The default implementation does nothing. Child classes can override if they wish to show their resulting objects sorted.

Overrides:
sortResolvedFilterStringObjects in class SubSystemImpl

getFirstParentFilterString

protected String getFirstParentFilterString(Object parent)
Called by parent when we defer getting a filter string until later, where we query it from the parent. In this case we need the first filter string for the progress monitor msg.

Overrides:
getFirstParentFilterString in class SubSystemImpl

internalResolveFilterString

protected Object[] internalResolveFilterString(IProgressMonitor monitor,
                                               Object parent,
                                               String filterString)
                                        throws InvocationTargetException,
                                               InterruptedException
Actually resolve a relative filter string. This is called by the run(IProgressMonitor monitor) method, which in turn is called by resolveFilterString.

As per IRunnableWithProgress rules:

YOU MUST OVERRIDE THIS IF YOU SUPPORT FILTERS!

Overrides:
internalResolveFilterString in class SubSystemImpl
Throws:
InvocationTargetException
InterruptedException

internalResolveOneFilterString

protected Object[] internalResolveOneFilterString(IProgressMonitor monitor,
                                                  Object parent,
                                                  RemoteFileFilterString fs,
                                                  boolean sort)
                                           throws InvocationTargetException,
                                                  InterruptedException
Do one filter string relative resolve

Throws:
InvocationTargetException
InterruptedException

listRoots

public IRemoteFile[] listRoots()
                        throws InterruptedException
Return a list of roots/drives on the remote system

Specified by:
listRoots in interface RemoteFileSubSystem
Throws:
InterruptedException

listRoots

public IRemoteFile[] listRoots(IRemoteFileContext context)
                        throws InterruptedException
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

Throws:
InterruptedException

listFolders

public IRemoteFile[] listFolders(IRemoteFile parent)
Return a list of all remote folders in the given parent folder on the remote system

Specified by:
listFolders in interface RemoteFileSubSystem
Parameters:
parent - The parent folder to list folders in

listFolders

public IRemoteFile[] listFolders(IRemoteFile parent,
                                 String fileNameFilter)
Return a full list of remote folders in the given parent folder on the remote system.

Specified by:
listFolders in interface RemoteFileSubSystem
Parameters:
parent - The parent folder to list folders in
fileNameFilter - The name pattern for subsetting the file list when this folder is subsequently expanded

listFolders

public IRemoteFile[] listFolders(IRemoteFile parent,
                                 String fileNameFilter,
                                 IRemoteFileContext context)
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) noteThis method should be abstract but MOF doesn't allow abstract impl classes at this point

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

listFiles

public IRemoteFile[] listFiles(IRemoteFile parent)
Return a list of all remote files in the given parent folder on the remote system

Specified by:
listFiles in interface RemoteFileSubSystem
Parameters:
parent - The parent folder to list files in

listFiles

public IRemoteFile[] listFiles(IRemoteFile parent,
                               String fileNameFilter)
Return a list of remote files in the given folder, which match the given name pattern.

Specified by:
listFiles in interface RemoteFileSubSystem
Parameters:
parent - The parent folder to list files in
fileNameFilter - The name pattern to subset the list by, or null to return all files.

listFiles

public IRemoteFile[] listFiles(IRemoteFile parent,
                               String fileNameFilter,
                               IRemoteFileContext context)
Return a list of remote files in the given folder, which match the given name pattern. 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

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

listFoldersAndFiles

public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent)
Return a list of all remote folders and files in the given folder. The list is not subsetted.

Specified by:
listFoldersAndFiles in interface RemoteFileSubSystem
Parameters:
parent - The parent folder to list folders and files in

listFoldersAndFiles

public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent,
                                         String fileNameFilter)
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.

Specified by:
listFoldersAndFiles in interface RemoteFileSubSystem
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.

listFoldersAndFiles

public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent,
                                         String fileNameFilter,
                                         IRemoteFileContext context)
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) noteThis method should be abstract but MOF doesn't allow abstract impl classes at this point

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

getParentFolder

public IRemoteFile getParentFolder(IRemoteFile folderOrFile)
Given a folder or file, return its parent folder object. noteThis method should be abstract but MOF doesn't allow abstract impl classes at this point

Specified by:
getParentFolder in interface RemoteFileSubSystem
Parameters:
folderOrFile - folder or file to return parent of.

getParentFolderName

public String getParentFolderName(IRemoteFile folderOrFile)
Given a folder or file, return its parent folder name, fully qualified

Specified by:
getParentFolderName in interface RemoteFileSubSystem
Parameters:
folderOrFile - folder or file to return parent of.

getRemoteFileObject

public IRemoteFile getRemoteFileObject(String folderOrFileName)
                                throws SystemMessageException
Given a fully qualified file or folder name, return an IRemoteFile object for it. noteThis method should be abstract but MOF doesn't allow abstract impl classes at this point

Specified by:
getRemoteFileObject in interface RemoteFileSubSystem
Parameters:
folderOrFileName - Fully qualified folder or file name
Throws:
SystemMessageException

getRemoteSearchResultObject

public IRemoteSearchResult getRemoteSearchResultObject(String key)
                                                throws SystemMessageException
Description copied from interface: RemoteFileSubSystem
Given a key, returns a search result object for it. For the key, see <

Specified by:
getRemoteSearchResultObject in interface RemoteFileSubSystem
Parameters:
key - the key that uniquely identifies a search result.
Throws:
SystemMessageException
See Also:
RemoteFileSubSystem.getRemoteSearchResultObject(java.lang.String)

getRemoteFileObject

public IRemoteFile getRemoteFileObject(IRemoteFile parent,
                                       String folderOrFileName)
                                throws SystemMessageException
Given a un-qualified file or folder name, and its parent folder object, return an IRemoteFile object for the file. noteThis method should be abstract but MOF doesn't allow abstract impl classes at this point

Specified by:
getRemoteFileObject in interface RemoteFileSubSystem
Parameters:
parent - Folder containing the folder or file
folderOrFileName - Un-qualified folder or file name
Throws:
SystemMessageException

getObjectWithAbsoluteName

public Object getObjectWithAbsoluteName(String key)
                                 throws Exception
Return the object within the subsystem that corresponds to the specified unique ID. For remote files, assuming the key is the absolute path of a file, this is simply a wrapper to getRemoteFileObject().

Specified by:
getObjectWithAbsoluteName in interface IRemoteObjectResolver
Overrides:
getObjectWithAbsoluteName in class SubSystemImpl
Throws:
Exception

createFile

public IRemoteFile createFile(IRemoteFile fileToCreate)
                       throws RemoteFileSecurityException,
                              RemoteFileIOException
Create a new file, given its IRemoteFile object (these do not have to represent existing files).

noteThis method should be abstract but MOF doesn't allow abstract impl classes at this point

Specified by:
createFile in interface RemoteFileSubSystem
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:
createFolders(IRemoteFile)

createFolder

public IRemoteFile createFolder(IRemoteFile folderToCreate)
                         throws RemoteFileSecurityException,
                                RemoteFileIOException
Create a new folder, given its IRemoteFile object (these do not have to represent existing folders)

noteThis method should be abstract but MOF doesn't allow abstract impl classes at this point

Specified by:
createFolder in interface RemoteFileSubSystem
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:
createFolders(IRemoteFile)

createFolders

public IRemoteFile createFolders(IRemoteFile folderToCreate)
                          throws RemoteFileSecurityException,
                                 RemoteFileIOException
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.

noteThis method should be abstract but MOF doesn't allow abstract impl classes at this point

Specified by:
createFolders in interface RemoteFileSubSystem
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:
getParentFolder(IRemoteFile)

delete

public boolean delete(IRemoteFile folderOrFile)
               throws RemoteFolderNotEmptyException,
                      RemoteFileSecurityException,
                      RemoteFileIOException
Delete the given remote file or folder. noteThis method should be abstract but MOF doesn't allow abstract impl classes at this point

Specified by:
delete in interface RemoteFileSubSystem
Parameters:
folderOrFile - represents the object to be deleted.
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

rename

public boolean rename(IRemoteFile folderOrFile,
                      String newName)
               throws RemoteFileIOException,
                      RemoteFileSecurityException
Rename the given remote file or folder. This renames it in memory and, iff it exists, on disk. noteThis method should be abstract but MOF doesn't allow abstract impl classes at this point

Specified by:
rename in interface RemoteFileSubSystem
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:
RemoteFileIOException
RemoteFileSecurityException

move

public boolean move(IRemoteFile sourceFolderOrFile,
                    IRemoteFile targetFolder,
                    String newName)
             throws RemoteFileSecurityException,
                    RemoteFileIOException
Move a file or folder to a new target parent folder.

Specified by:
move in interface RemoteFileSubSystem
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
Returns:
true iff the move succeeded
Throws:
RemoteFileSecurityException
RemoteFileIOException

setLastModified

public boolean setLastModified(IRemoteFile folderOrFile,
                               long newDate)
                        throws RemoteFileIOException,
                               RemoteFileSecurityException
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. noteThis method should be abstract but MOF doesn't allow abstract impl classes at this point

Specified by:
setLastModified in interface RemoteFileSubSystem
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:
RemoteFileIOException
RemoteFileSecurityException

setReadOnly

public boolean setReadOnly(IRemoteFile folderOrFile)
                    throws RemoteFileSecurityException,
                           RemoteFileIOException
Set a file to readonly. Folder or file must exist on disk for this to succeed. noteThis method should be abstract but MOF doesn't allow abstract impl classes at this point

Specified by:
setReadOnly in interface RemoteFileSubSystem
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

setListValues

protected void setListValues(int includeFilesOrFolders,
                             String nameFilter)
Method to set variables to affect the folder content subsetting. Use this when only listing either files or folders, but not both.

Parameters:
includeFilesOrFolders - A constant from IFileConstants
nameFilter - The pattern to filter the file or folder names by. Can be null to include all.

setListValues

protected void setListValues(int includeFilesOrFolders,
                             String folderNameFilter,
                             String fileNameFilter)
Overloaded method to set variables to affect the folder content subsetting, when there is separate filters for both folder names and filter names.

Parameters:
includeFilesOrFolders - A constant from IFileConstants
folderNameFilter - The pattern to filter the folder names by. Can be null to include all folders

accept

protected boolean accept(String name,
                         boolean isFile)
Method to decide if a given folder or file name matches the present criteria. You must have previously called setListValues(int, String) or setListValues(int, String, String)

Parameters:
name - The file or folder name to test
isFile - true if this is a file name, false if it is a folder name.
Returns:
true if the name matches the previously specified criteria

copy

public void copy(IRemoteFile source,
                 String destination,
                 IProgressMonitor monitor)
          throws RemoteFileSecurityException,
                 RemoteFileIOException
Get the remote file and save it locally. The file is saved in the encoding of the operating system.

Specified by:
copy in interface RemoteFileSubSystem
Parameters:
source - remote file that represents the file to be obtained
destination - the absolute path of the local file
monitor - the progress monitor
Throws:
RemoteFileSecurityException
RemoteFileIOException

copyUTF8

public void copyUTF8(IRemoteFile source,
                     String destination,
                     IProgressMonitor monitor)
              throws RemoteFileSecurityException,
                     RemoteFileIOException
Get the remote file and save it locally. The file is saved in UTF-8 encoding. This is a recommended method to use for file transfer

Specified by:
copyUTF8 in interface RemoteFileSubSystem
Parameters:
source - remote file that represents the file to be obtained
destination - the absolute path of the local file
monitor - the progress monitor
Throws:
RemoteFileSecurityException
RemoteFileIOException

copy

public void copy(IRemoteFile source,
                 File destination,
                 IProgressMonitor monitor)
          throws RemoteFileSecurityException,
                 RemoteFileIOException
Get the remote file and save it locally. The file is saved in the encoding of the operating system.

Specified by:
copy in interface RemoteFileSubSystem
Parameters:
source - remote file that represents the file to be obtained
destination - the local file
monitor - the progress monitor
Throws:
RemoteFileSecurityException
RemoteFileIOException

copy

public void copy(IRemoteFile source,
                 File destination,
                 String encoding,
                 IProgressMonitor monitor)
          throws RemoteFileSecurityException,
                 RemoteFileIOException
Get the remote file and save it locally. The file is saved in the encoding specified.

Specified by:
copy in interface RemoteFileSubSystem
Parameters:
source - remote file that represents the file to be obtained
destination - the local file
encoding - the encoding of the local file
monitor - the progress monitor
Throws:
RemoteFileSecurityException
RemoteFileIOException

copyUTF8

public void copyUTF8(IRemoteFile source,
                     File destination,
                     IProgressMonitor monitor)
              throws RemoteFileSecurityException,
                     RemoteFileIOException
Get the remote file and save it locally. The file is saved in UTF-8 encoding. This is a recommended method to use for file transfer

Specified by:
copyUTF8 in interface RemoteFileSubSystem
Parameters:
source - remote file that represents the file to be obtained
destination - the local file
monitor - the progress monitor
Throws:
RemoteFileSecurityException
RemoteFileIOException

copy

public void copy(String source,
                 IRemoteFile destination,
                 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:
copy in interface RemoteFileSubSystem
Parameters:
source - the absolute path of the local copy
destination - remote file that represents the file on the server
monitor - the progress monitor
Throws:
RemoteFileSecurityException
RemoteFileIOException

copyLocalToRemote

public void copyLocalToRemote(String source,
                              String destination,
                              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:
copyLocalToRemote in interface RemoteFileSubSystem
Parameters:
source - the absolute path of the local copy
destination - remote file that represents the file on the server
monitor - the progress monitor
Throws:
RemoteFileSecurityException
RemoteFileIOException

copyLocalToRemote

public void copyLocalToRemote(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:
copyLocalToRemote in interface RemoteFileSubSystem
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

copyUTF8

public void copyUTF8(String source,
                     IRemoteFile destination,
                     IProgressMonitor monitor)
              throws RemoteFileSecurityException,
                     RemoteFileIOException
Put the local copy of the remote file back to the remote location. The local file must be in UTF-8 encoding.

Specified by:
copyUTF8 in interface RemoteFileSubSystem
Parameters:
source - the absolute path of the local copy
destination - remote file that represents the file on the server
monitor - the progress monitor
Throws:
RemoteFileSecurityException
RemoteFileIOException

copy

public void copy(File source,
                 IRemoteFile destination,
                 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:
copy in interface RemoteFileSubSystem
Parameters:
source - the local copy
destination - remote file that represents the file on the server
monitor - the progress monitor
Throws:
RemoteFileSecurityException
RemoteFileIOException

copy

public void copy(File 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 specified

Specified by:
copy in interface RemoteFileSubSystem
Parameters:
source - 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:
RemoteFileSecurityException
RemoteFileIOException

copyUTF8

public void copyUTF8(File source,
                     IRemoteFile destination,
                     IProgressMonitor monitor)
              throws RemoteFileSecurityException,
                     RemoteFileIOException
Put the local copy of the remote file back to the remote location. The local file must be in UTF-8 encoding.

Specified by:
copyUTF8 in interface RemoteFileSubSystem
Parameters:
source - the local copy
destination - remote file that represents the file on the server
monitor - the progress monitor
Throws:
RemoteFileSecurityException
RemoteFileIOException

runLocalCommand

public void runLocalCommand(String cmd)
                     throws Exception
Throws:
Exception

runLocalCommand

public static int runLocalCommand(String cmd,
                                  Vector lines)
                           throws Exception
helper method to run an external command

Throws:
Exception

getHomeFolder

public String getHomeFolder()
Specified by:
getHomeFolder in interface RemoteFileSubSystem
Returns:
The value of the HomeFolder attribute

setHomeFolder

public void setHomeFolder(String newHomeFolder)
Specified by:
setHomeFolder in interface RemoteFileSubSystem
Parameters:
newHomeFolder - The new value of the HomeFolder attribute

cacheRemoteFile

public void cacheRemoteFile(IRemoteFile file,
                            String path)
Store the IRemoteFile in a hashmap to quick subsequent retrieval

Parameters:
file - the file

cacheRemoteFile

public void cacheRemoteFile(IRemoteFile file)
Store the IRemoteFile in a hashmap to quick subsequent retrieval

Parameters:
file - the file

getCachedRemoteFile

public IRemoteFile getCachedRemoteFile(String path)
Returns the cached remote file with the specified path. If no such file is found, returns null

Parameters:
path -
Returns:
the cached file, if found in the cache, else null

removeCachedRemoteFile

protected void removeCachedRemoteFile(IRemoteFile file)

removeCachedRemoteFile

protected void removeCachedRemoteFile(String path)

communicationsStateChange

public void communicationsStateChange(CommunicationsEvent e)
Description copied from interface: ICommunicationsListener
This method is invoked whenever the communications state is invoked immediately before and after the state of the communications changes. The state field in CommunicationsEvent determines which state change is about to or has occured.

Specified by:
communicationsStateChange in interface ICommunicationsListener

isPassiveCommunicationsListener

public boolean isPassiveCommunicationsListener()
Description copied from interface: ICommunicationsListener
This method determines if the communications listener is a passive or active listener. Typically a passive listener registers with the communications system and responds to events as they occur. An active listener typically registeres with the communications system only for the duration of the task (i.e. user editing a file, or outstanding communications request.) The user will be prompted on a disconnect if there are any active communication listeners registered.

Specified by:
isPassiveCommunicationsListener in interface ICommunicationsListener
Returns:
false if the communications listener is an active listener, true if the communications listener is a passive listener.
See Also:
ICommunicationsListener.isPassiveCommunicationsListener()

eInverseAdd

public NotificationChain eInverseAdd(InternalEObject otherEnd,
                                     int featureID,
                                     Class baseClass,
                                     NotificationChain msgs)

Overrides:
eInverseAdd in class SubSystemImpl

eInverseRemove

public NotificationChain eInverseRemove(InternalEObject otherEnd,
                                        int featureID,
                                        Class baseClass,
                                        NotificationChain msgs)

Overrides:
eInverseRemove in class SubSystemImpl

eGet

public Object eGet(EStructuralFeature eFeature,
                   boolean resolve)

Overrides:
eGet in class SubSystemImpl

eIsSet

public boolean eIsSet(EStructuralFeature eFeature)
Description copied from class: SubSystemImpl
Private. Do not call or override.

Overrides:
eIsSet in class SubSystemImpl

eSet

public void eSet(EStructuralFeature eFeature,
                 Object newValue)
Description copied from class: SubSystemImpl
Private. Do not call or override.

Overrides:
eSet in class SubSystemImpl

eUnset

public void eUnset(EStructuralFeature eFeature)
Description copied from class: SubSystemImpl
Private. Do not call or override.

Overrides:
eUnset in class SubSystemImpl

toString

public String toString()
Overrides:
toString in class SubSystemImpl

getLanguageUtilityFactory

public ILanguageUtilityFactory getLanguageUtilityFactory()
Returns null. Subclasses should override if necessary.

Specified by:
getLanguageUtilityFactory in interface RemoteFileSubSystem
Returns:
the language utility factory associated with this subsystem.
See Also:
RemoteFileSubSystem.getLanguageUtilityFactory()

getUnusedPort

public int getUnusedPort()
Returns -1 by default. Subclasses should override if necessary.

Specified by:
getUnusedPort in interface RemoteFileSubSystem
Returns:
an unused port number on the host, or -1 if none could be found.
See Also:
RemoteFileSubSystem.getUnusedPort()

getLocalAddress

public InetAddress getLocalAddress()
Returns the address found by calling InetAddress.getLocalHost(). If that call returns the local loopback address, it returns null. Subclasses should reimplement to handle cases where systems have multiple IP addresses due to multiple network cards or VPN. This method should return an address that is usable from the remote system to connect back to the local system.

Specified by:
getLocalAddress in interface RemoteFileSubSystem
Returns:
the local TCP/IP address accessible from the remote system, or null if no address can be resolved.
See Also:
RemoteFileSubSystem.getLocalAddress()

getTargetForFilter

public Object getTargetForFilter(SystemFilterReference filterRef)
Description copied from interface: SubSystem
Returns the parent object associated with a filter reference. It's up to the subsystem implementation to decide what "parent object" means for a filter reference.

Specified by:
getTargetForFilter in interface SubSystem
Overrides:
getTargetForFilter in class SubSystemImpl

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.