Remote Systems
v6.4.1

com.ibm.etools.systems.localfilesubsys.impl
Class LocalFileSubSystemImpl

java.lang.Object
  extended byEObjectImpl
      extended bycom.ibm.etools.systems.subsystems.impl.SubSystemImpl
          extended bycom.ibm.etools.systems.subsystems.impl.RemoteFileSubSystemImpl
              extended bycom.ibm.etools.systems.localfilesubsys.impl.LocalFileSubSystemImpl
All Implemented Interfaces:
FileFilter, IAdaptable, ICommunicationsListener, IRemoteObjectResolver, ISystemResourceChangeEvents, LocalFileSubSystem, RemoteFileSubSystem, SubSystem, SystemFilterPoolReferenceManagerProvider

public class LocalFileSubSystemImpl
extends RemoteFileSubSystemImpl
implements FileFilter, LocalFileSubSystem

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
static String copyright
           
 
Fields inherited from class com.ibm.etools.systems.subsystems.impl.RemoteFileSubSystemImpl
_cachedRemoteFiles, _searchHistory, currFilterString, DEFAULT_CONTEXT, DEFAULT_CONTEXT_NOFILTERSTRING, FILTERSTRING_LISTROOTS, HOME_FOLDER_EDEFAULT, homeFolder, osCmdShell, osName, osVarsSet, osWindows, osWindows95, 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
LocalFileSubSystemImpl()
          Constructor.
 
Method Summary
 boolean accept(File file)
          Method required by FilenameFilter interface, used by java.io.File.list()
 void cancelSearch(IRemoteSearchResultConfiguration searchConfig)
          Given a search configuration, cancel the search.
 void copy(InputStream stream, long totalBytes, IRemoteFile destination, String encoding, IProgressMonitor monitor)
          Put local data to a remote location.
 boolean copy(IRemoteFile sourceFolderOrFile, IRemoteFile targetFolder, String newName, IProgressMonitor monitor)
          Copy a file or folder to a new target parent folder.
 void copy(IRemoteFile source, String destination, String encoding, IProgressMonitor monitor)
          Get the remote file and save it locally.
 void copy(String source, IRemoteFile destination, String encoding, IProgressMonitor monitor)
          Put the local copy of the remote file back to the remote location.
 boolean copyFromArchiveWithEncoding(IRemoteFile sourceFolderOrFile, IRemoteFile targetFolder, String newName, String sourceEncoding, boolean isText, IProgressMonitor monitor)
          Copy a file or folder to a new target parent folder, but if copying from an archive, extract the file in the encoding specified
 void copyLocalToRemote(InputStream stream, long totalBytes, String srcEncoding, String remotePath, String rmtEncoding, IProgressMonitor monitor)
          Put the local data to the remote file on the local system.
 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.
 boolean copyToArchiveWithEncoding(IRemoteFile sourceFolderOrFile, IRemoteFile targetFolder, String newName, String targetEncoding, IProgressMonitor monitor)
          Copy a file or folder to a new target parent folder, but if copying to an archive, package the file in the encoding specified
 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.
 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)
           
 void eSet(EStructuralFeature eFeature, Object newValue)
           
protected  EClass eStaticClass()
           
 void eUnset(EStructuralFeature eFeature)
           
 ILanguageUtilityFactory getLanguageUtilityFactory()
          Returns an instance of LocalLanguageUtilityFactory.
 IRemoteFile getParentFolder(IRemoteFile folderOrFile)
          Given a folder or file, return its parent folder object.
 PropertyPage getPropertyPage(Composite parent)
          Override so we are sure no pages are contributed to the subsystems tab of the property page for the parent connection.
 String getRemoteEncoding()
          Returns the encoding of the local file system.
 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.
 IRemoteSearchResultConfigurationFactory getRemoteSearchResultConfigurationFactory()
          Gets the search result configuration factory associated with the subsystem.
 AbstractSystemManager getSystemManager()
          Return a singleton instance of an AbstractSystemManager subclass that manages a pool of ISystem objects, one per system connection.
 int getUnusedPort()
          Returns an unused port number, or -1 if none.
 boolean isCaseSensitive()
          Return true if file names are case-sensitive.
 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, String folderNameFilter, IRemoteFileContext context)
          Return a subsetted list of remote folders in the given parent folder on the remote system.
 IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context)
          Return a list of remote folders and files in the given folder.
 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.
 boolean rename(IRemoteFile folderOrFile, String newName)
          Rename the given remote file or folder.
 void search(IRemoteSearchResultConfiguration searchConfig)
          Given a search configuration, searches for its results.
 boolean setLastModified(IRemoteFile folderOrFile, long newDate)
          Set the last modified date for the given file or folder.
 boolean setReadOnly(IRemoteFile folderOrFile)
          Set this file to be readonly.
 
Methods inherited from class com.ibm.etools.systems.subsystems.impl.RemoteFileSubSystemImpl
accept, addResolvedFilterStringObjects, cacheRemoteFile, cacheRemoteFile, checkForCancel, communicationsStateChange, copy, copy, copy, copy, copy, copy, copyLocalToRemote, copyUTF8, copyUTF8, copyUTF8, copyUTF8, doesFilterStringListContentsOf, doesFilterStringMatch, getCachedRemoteFile, getContext, getContext, getCurrentFilterString, getDefaultContext, getDefaultContextNoFilterString, getFilterStringListRoots, getFirstParentFilterString, getHomeFolder, getLineSeparator, getLocalAddress, getObjectWithAbsoluteName, getParentFolderName, getParentRemoteFileSubSystemFactory, getPathSeparator, getPathSeparatorChar, getRemoteSearchResultObject, getSeparator, getSeparatorChar, getTargetForFilter, internalResolveFilterString, internalResolveFilterString, internalResolveFilterStrings, internalResolveOneFilterString, isPassiveCommunicationsListener, listFiles, listFiles, listFolders, listFolders, listFoldersAndFiles, listFoldersAndFiles, listRoots, removeCachedRemoteFile, removeCachedRemoteFile, runLocalCommand, runLocalCommand, setHomeFolder, setListValues, setListValues, sortResolvedFilterStringObjects, 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, 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
copy, copy, copy, copy, copy, copy, copyLocalToRemote, copyUTF8, copyUTF8, copyUTF8, copyUTF8, getHomeFolder, getLineSeparator, getLocalAddress, getParentFolderName, getParentRemoteFileSubSystemFactory, getPathSeparator, getPathSeparatorChar, getRemoteSearchResultObject, getSeparator, getSeparatorChar, listFiles, listFiles, listFolders, listFolders, listFoldersAndFiles, listFoldersAndFiles, listRoots, setHomeFolder
 
Methods inherited from interface com.ibm.etools.systems.subsystems.SubSystem
checkIsConnected, clearLocalUserId, connect, connect, connect, deletingConnection, disconnect, disconnect, doesFilterListContentsOf, doesFilterMatch, doesFilterStringListContentsOf, doesFilterStringMatch, forceUserIdToUpperCase, getAdditionalAttributes, getCacheManager, getChildren, getCommandSubSystem, getFactoryId, getFilterPoolReferenceManager, getIbmAttributes, getLocalUserId, getName, getParentSubSystemFactory, getPort, getPortAsInt, getPrimarySubSystem, getProperties, getProperty, getRemoteServerLauncher, getSaveFileName, getSystem, getSystemConnection, getSystemConnectionName, getSystemFilterPoolReferenceManager, getSystemProfile, getSystemProfileName, getTargetForFilter, 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
 
Methods inherited from interface com.ibm.etools.systems.subsystems.IRemoteObjectResolver
getObjectWithAbsoluteName
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values
Constructor Detail

LocalFileSubSystemImpl

public LocalFileSubSystemImpl()
Constructor. Called by EMF

Method Detail

eStaticClass

protected EClass eStaticClass()

Overrides:
eStaticClass in class RemoteFileSubSystemImpl

eInverseAdd

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

Overrides:
eInverseAdd in class RemoteFileSubSystemImpl

eInverseRemove

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

Overrides:
eInverseRemove in class RemoteFileSubSystemImpl

eGet

public Object eGet(EStructuralFeature eFeature,
                   boolean resolve)

Overrides:
eGet in class RemoteFileSubSystemImpl

eSet

public void eSet(EStructuralFeature eFeature,
                 Object newValue)

Overrides:
eSet in class RemoteFileSubSystemImpl

eUnset

public void eUnset(EStructuralFeature eFeature)

Overrides:
eUnset in class RemoteFileSubSystemImpl

eIsSet

public boolean eIsSet(EStructuralFeature eFeature)

Overrides:
eIsSet in class RemoteFileSubSystemImpl

getPropertyPage

public PropertyPage getPropertyPage(Composite parent)
Override so we are sure no pages are contributed to the subsystems tab of the property page for the parent connection.

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

getSystemManager

public AbstractSystemManager getSystemManager()
Return a singleton instance of an AbstractSystemManager subclass that manages a pool of ISystem objects, one per system connection. By default, getSystem() calls this, unless you override getSystem().

Specified by:
getSystemManager in interface SubSystem
Overrides:
getSystemManager in class SubSystemImpl
Returns:
LocalSystemManager.getTheLocalSystemManager()

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
Overrides:
isCaseSensitive in class RemoteFileSubSystemImpl

listRoots

public IRemoteFile[] listRoots(IRemoteFileContext context)
Return a list of roots/drives on the remote system. This version is called by RemoteFileSubSystemImpl's resolveFilterString(s)

Overrides:
listRoots in class RemoteFileSubSystemImpl

search

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

Specified by:
search in interface RemoteFileSubSystem
Parameters:
searchConfig - a search configuration.
See Also:
RemoteFileSubSystem.search(com.ibm.etools.systems.subsystems.IRemoteSearchResultConfiguration)

cancelSearch

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

Specified by:
cancelSearch in interface RemoteFileSubSystem
Parameters:
searchConfig - a search configuration.
See Also:
RemoteFileSubSystem.cancelSearch(com.ibm.etools.systems.subsystems.IRemoteSearchResultConfiguration)

getRemoteEncoding

public String getRemoteEncoding()
Returns the encoding of the local file system. This is the text file encoding specified in preferences, i.e. the PREF_ENCODING preference, or the file system encoding (System.getProperty("file.encoding")) if the preference is not set.

Specified by:
getRemoteEncoding in interface RemoteFileSubSystem
Returns:
the encoding of the local file system.

getRemoteSearchResultConfigurationFactory

public IRemoteSearchResultConfigurationFactory getRemoteSearchResultConfigurationFactory()
Description copied from interface: RemoteFileSubSystem
Gets the search result configuration factory associated with the subsystem.

Specified by:
getRemoteSearchResultConfigurationFactory in interface RemoteFileSubSystem
Returns:
the remote search result configuration factory.
See Also:
RemoteFileSubSystem.getRemoteSearchResultConfigurationFactory()

listFolders

public IRemoteFile[] listFolders(IRemoteFile parent,
                                 String folderNameFilter,
                                 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)

Overrides:
listFolders in class RemoteFileSubSystemImpl
Parameters:
parent - The parent folder to list folders in
folderNameFilter - The name pattern for subsetting the list
context - The holder of state information

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)

Overrides:
listFiles in class RemoteFileSubSystemImpl
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,
                                         String fileNameFilter,
                                         IRemoteFileContext context)
Return a list of remote folders and files in the given folder. Only the files are subsettable by name, all folders are returned. This version is called by RemoteFileSubSystemImpl's resolveFilterString(s)

Overrides:
listFoldersAndFiles in class RemoteFileSubSystemImpl
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. We

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

getRemoteFileObject

public IRemoteFile getRemoteFileObject(String folderOrFileName)
Given a fully qualified file or folder name, return an IRemoteFile object for it.

Specified by:
getRemoteFileObject in interface RemoteFileSubSystem
Overrides:
getRemoteFileObject in class RemoteFileSubSystemImpl
Parameters:
folderOrFileName - Fully qualified folder or file name

getRemoteFileObject

public 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.

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

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).

Specified by:
createFile in interface RemoteFileSubSystem
Overrides:
createFile in class RemoteFileSubSystemImpl
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)

Specified by:
createFolder in interface RemoteFileSubSystem
Overrides:
createFolder in class RemoteFileSubSystemImpl
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.

Specified by:
createFolders in interface RemoteFileSubSystem
Overrides:
createFolders in class RemoteFileSubSystemImpl
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.

Specified by:
delete in interface RemoteFileSubSystem
Overrides:
delete in class RemoteFileSubSystemImpl
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.

Specified by:
rename in interface RemoteFileSubSystem
Overrides:
rename in class RemoteFileSubSystemImpl
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

setLastModified

public boolean setLastModified(IRemoteFile folderOrFile,
                               long newDate)
                        throws RemoteFileSecurityException,
                               RemoteFileIOException
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 RemoteFileSubSystem
Overrides:
setLastModified in class RemoteFileSubSystemImpl
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
Set this file to be readonly. Folder or file must exist on disk for this to succeed.

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

copy

public boolean copy(IRemoteFile sourceFolderOrFile,
                    IRemoteFile targetFolder,
                    String newName,
                    IProgressMonitor monitor)
             throws RemoteFileSecurityException,
                    RemoteFileIOException
Copy a file or folder to a new target parent folder.

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

copyToArchiveWithEncoding

public boolean copyToArchiveWithEncoding(IRemoteFile sourceFolderOrFile,
                                         IRemoteFile targetFolder,
                                         String newName,
                                         String targetEncoding,
                                         IProgressMonitor monitor)
                                  throws RemoteFileSecurityException,
                                         RemoteFileIOException
Copy a file or folder to a new target parent folder, but if copying to an archive, package the file in the encoding specified

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:
true iff the copy succeeded
Throws:
RemoteFileSecurityException
RemoteFileIOException

copyFromArchiveWithEncoding

public boolean copyFromArchiveWithEncoding(IRemoteFile sourceFolderOrFile,
                                           IRemoteFile targetFolder,
                                           String newName,
                                           String sourceEncoding,
                                           boolean isText,
                                           IProgressMonitor monitor)
                                    throws RemoteFileSecurityException,
                                           RemoteFileIOException
Copy a file or folder to a new target parent folder, but if copying from an archive, extract the file in the encoding specified

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:
true iff the copy succeeded
Throws:
RemoteFileSecurityException
RemoteFileIOException

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
Overrides:
move in class RemoteFileSubSystemImpl
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

copy

public void copy(IRemoteFile source,
                 String 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 absolute path of the local file
encoding - the encoding of the local file
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 specified

Specified by:
copyLocalToRemote in interface RemoteFileSubSystem
Overrides:
copyLocalToRemote in class RemoteFileSubSystemImpl
Parameters:
source - the absolute path of the local copy
srcEncoding - the encoding of the local copy
remotePath - remote path that represents the file on the server
rmtEncoding - the encoding of the remote file.
Throws:
RemoteFileSecurityException
RemoteFileIOException

copyLocalToRemote

public void copyLocalToRemote(InputStream stream,
                              long totalBytes,
                              String srcEncoding,
                              String remotePath,
                              String rmtEncoding,
                              IProgressMonitor monitor)
                       throws RemoteFileSecurityException,
                              RemoteFileIOException
Put the local data to the remote file on the local system.

Parameters:
stream - the input stream with local data.
totalBytes - the total number of bytes to read, or -1 if unknown. If -1 is specified, then the progress monitor must be null.
srcEncoding - the encoding of the local data.
remotePath - remote path that represents the file on the server
rmtEncoding - the encoding of the remote file.
monitor - the progress monitor, or code if none is required.
Throws:
RemoteFileSecurityException
RemoteFileIOException

copy

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

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
encoding - the encoding of the local copy
monitor - the progress monitor
Throws:
RemoteFileSecurityException
RemoteFileIOException

copy

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

Specified by:
copy in interface RemoteFileSubSystem
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
See Also:
RemoteFileSubSystem.copy(java.io.InputStream, long, com.ibm.etools.systems.subsystems.IRemoteFile, java.lang.String, org.eclipse.core.runtime.IProgressMonitor)

accept

public boolean accept(File file)
Method required by FilenameFilter interface, used by java.io.File.list()

Specified by:
accept in interface FileFilter

getLanguageUtilityFactory

public ILanguageUtilityFactory getLanguageUtilityFactory()
Returns an instance of LocalLanguageUtilityFactory.

Specified by:
getLanguageUtilityFactory in interface RemoteFileSubSystem
Overrides:
getLanguageUtilityFactory in class RemoteFileSubSystemImpl
See Also:
RemoteFileSubSystem.getLanguageUtilityFactory()

getUnusedPort

public int getUnusedPort()
Returns an unused port number, or -1 if none.

Specified by:
getUnusedPort in interface RemoteFileSubSystem
Overrides:
getUnusedPort in class RemoteFileSubSystemImpl
See Also:
RemoteFileSubSystem.getUnusedPort()

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.