RSE
Release 2.0

org.eclipse.rse.subsystems.files.core.subsystems
Interface IRemoteFileSubSystem

All Superinterfaces:
IPropertySetContainer, IRemoteObjectResolver, IRSEModelObject, IRSEPersistableContainer, ISchedulingRule, ISubSystem, ISystemFilterPoolReferenceManagerProvider
All Known Subinterfaces:
IFileServiceSubSystem
All Known Implementing Classes:
FileServiceSubSystem, RemoteFileSubSystem

public interface IRemoteFileSubSystem
extends ISubSystem

Specialized interface for remote file subsystems.

These are unix/windows like file systems, versus native OS/400 or OS/390 file subsystems. Rather, it is more like the IFS and HFS systems on these operating systems.

The idea is to encourage a common API and GUI layer that works with any remote unix-like file system on any remote operating system.


Field Summary
 
Fields inherited from interface org.eclipse.rse.core.model.IRSEPersistableContainer
NO_CHILDREN
 
Method Summary
 void cancelSearch(IHostSearchResultConfiguration searchConfig)
          Given a search configuration, cancel the search.
 boolean copy(IRemoteFile sourceFolderOrFile, IRemoteFile targetFolder, String newName, IProgressMonitor monitor)
          Copy a file or folder to a new target parent folder.
 boolean copyBatch(IRemoteFile[] sourceFolderOrFile, IRemoteFile targetFolder, IProgressMonitor monitor)
          Copy a set of remote files or folders to a new target parent folder.
 IRemoteFile createFile(IRemoteFile fileToCreate, IProgressMonitor monitor)
          Create a new file, given its IRemoteFile object (these do not have to represent existing files).
 IRemoteFile createFolder(IRemoteFile folderToCreate, IProgressMonitor monitor)
          Create a new folder, given its IRemoteFile object (these do not have to represent existing folders) The parent folder must exist for this to succeed.
 IRemoteFile createFolders(IRemoteFile folderToCreate, IProgressMonitor monitor)
          Given an IRemoteFile for a folder, this will create that folder and any missing parent folders in its path.
 boolean delete(IRemoteFile folderOrFile, IProgressMonitor monitor)
          Delete the given remote file or folder.
 boolean deleteBatch(IRemoteFile[] folderOrFiles, IProgressMonitor monitor)
          Delete the given batch of remote file or folder.
 void download(IRemoteFile source, String destination, String encoding, IProgressMonitor monitor)
          Get the remote file and save it locally.
 InputStream getInputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor)
          Gets the input stream to access the contents a remote file.
 ILanguageUtilityFactory getLanguageUtilityFactory()
          Returns a language utility factory associated with this subsystem.
 String getLineSeparator()
          Return as a string the line separator.
 InetAddress getLocalAddress()
          Returns the TCP/IP address for the local system that is accessible from the remote server.
 OutputStream getOutputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor)
          Gets the output stream to write to a remote file.
 IRemoteFile getParentFolder(IRemoteFile folderOrFile, IProgressMonitor monitor)
          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
 IRemoteFileSubSystemConfiguration getParentRemoteFileSubSystemConfiguration()
          Return parent subsystem factory, cast to a RemoteFileSubSystemConfiguration
 String getPathSeparator()
          Return in string format the character used to separate paths.
 char getPathSeparatorChar()
          Return in char format the character used to separate paths.
 String getRemoteEncoding()
          Returns the encoding of the remote system.
 IRemoteFile getRemoteFileObject(IRemoteFile parent, String folderOrFileName, IProgressMonitor monitor)
          Given a un-qualified file or folder name, and its parent folder object, return an IRemoteFile object for the file.
 IRemoteFile getRemoteFileObject(String folderOrFileName, IProgressMonitor monitor)
          Given a fully qualified file or folder name, return an IRemoteFile object for it.
 SystemRemoteResourceSet getRemoteFileObjects(List folderOrFileNames, IProgressMonitor monitor)
          Given a set of fully qualified file or folder names, return an ISystemResourceSet 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.
 int getUnusedPort()
          Returns an unused port number on the remote host that could be used by any tool on the host.
 boolean isCaseSensitive()
          Return true if file names are case-sensitive.
 IRemoteFile[] listFiles(IRemoteFile parent, IProgressMonitor monitor)
          Return a list of all remote files in the given parent folder on the remote system
 IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor)
          Return a list of remote files in the given folder, which match the given name pattern.
 IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor)
          Return a list of remote files in the given folder, which match the given name pattern.
 IRemoteFile[] listFolders(IRemoteFile parent, IProgressMonitor monitor)
          Return a list of all remote folders in the given parent folder on the remote system
 IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor)
          Return a full list of remote folders in the given parent folder on the remote system.
 IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor)
          Return a subsetted list of remote folders in the given parent folder on the remote system.
 IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, IProgressMonitor monitor)
          Return a list of all remote folders and files in the given folder.
 IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor)
          Return a list of remote folders and files in the given folder.
 IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context, IProgressMonitor monitor)
          Return a list of remote folders and files in the given folder.
 IRemoteFile[] listRoots(IProgressMonitor monitor)
          Return a list of roots/drives on the remote system.
 IRemoteFile[] listRoots(IRemoteFileContext context, IProgressMonitor monitor)
          Return a list of roots/drives on the remote system.
 boolean move(IRemoteFile sourceFolderOrFile, IRemoteFile targetFolder, String newName, IProgressMonitor monitor)
          Move a file or folder to a new target parent folder.
 boolean rename(IRemoteFile folderOrFile, String newName, IProgressMonitor monitor)
          Rename the given remote file or folder.
 void search(IHostSearchResultConfiguration searchConfig)
          Given a search configuration, searches for its results.
 boolean setLastModified(IRemoteFile folderOrFile, long newDate, IProgressMonitor monitor)
          Set the last modified date for the given file or folder.
 boolean setReadOnly(IRemoteFile folderOrFile, boolean readOnly, IProgressMonitor monitor)
          Set a files read-only permissions.
 boolean supportsEncoding()
          Returns whether the file subsystem supports encodings.
 void upload(String source, IRemoteFile destination, String encoding, IProgressMonitor monitor)
          Put the local copy of the remote file back to the remote location.
 void upload(String source, String srcEncoding, String remotePath, String rmtEncoding, IProgressMonitor monitor)
          Put the local copy of the remote file back to the remote location.
 
Methods inherited from interface org.eclipse.rse.core.subsystems.ISubSystem
checkIsConnected, clearLocalUserId, connect, connect, connect, deletingConnection, disconnect, disconnect, doesFilterListContentsOf, doesFilterMatch, doesFilterStringListContentsOf, doesFilterStringMatch, forceUserIdToUpperCase, getCacheManager, getChildren, getConfigurationId, getConnectorService, getFilterPoolReferenceManager, getHost, getHostAliasName, getLocalUserId, getName, getPrimarySubSystem, getProperties, getProperty, getSubSystemConfiguration, getSystemFilterPoolReferenceManager, getSystemProfile, getSystemProfileName, getTargetForFilter, getUserId, getVendorAttribute, hasChildren, initializeSubSystem, isConnected, isConnectionError, isHidden, isOffline, isPrimarySubSystem, renamingConnection, renamingProfile, resolveFilterString, resolveFilterString, resolveFilterStrings, setConfigurationId, setConnectionError, setConnectorService, setFilterPoolReferenceManager, setHidden, setHost, setName, setProperties, setProperty, setSubSystemConfiguration, setVendorAttribute, supportsCaching, uninitializeSubSystem
 
Methods inherited from interface org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider
filterEventFilterCreated, filterEventFilterPoolReferenceCreated, filterEventFilterPoolReferenceDeleted, filterEventFilterPoolReferenceRenamed, filterEventFilterPoolReferenceReset, filterEventFilterPoolReferencesRePositioned, filterEventFilterPoolReferencesReset, filterEventFilterStringCreated, getUniqueOwningSystemFilterPool
 
Methods inherited from interface org.eclipse.rse.core.subsystems.IRemoteObjectResolver
getObjectWithAbsoluteName
 
Methods inherited from interface org.eclipse.core.runtime.jobs.ISchedulingRule
contains, isConflicting
 
Methods inherited from interface org.eclipse.rse.core.model.IRSEModelObject
getDescription
 
Methods inherited from interface org.eclipse.rse.core.model.IPropertySetContainer
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 
Methods inherited from interface org.eclipse.rse.core.model.IRSEPersistableContainer
commit, getPersistableChildren, getPersistableParent, isDirty, isTainted, setDirty, setTainted, setWasRestored, wasRestored
 

Method Detail

getParentRemoteFileSubSystemConfiguration

IRemoteFileSubSystemConfiguration getParentRemoteFileSubSystemConfiguration()
Return parent subsystem factory, cast to a RemoteFileSubSystemConfiguration


isCaseSensitive

boolean isCaseSensitive()
Return true if file names are case-sensitive. Used when doing name or type filtering


getSeparator

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


getSeparatorChar

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


getPathSeparator

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


getPathSeparatorChar

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


getLineSeparator

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


listRoots

IRemoteFile[] listRoots(IProgressMonitor monitor)
                        throws InterruptedException,
                               SystemMessageException
Return a list of roots/drives on the remote system. This version is called directly by users.

Throws:
InterruptedException
SystemMessageException

listFolders

IRemoteFile[] listFolders(IRemoteFile parent,
                          IProgressMonitor monitor)
                          throws SystemMessageException
Return a list of all remote folders in the given parent folder on the remote system

Parameters:
parent - The parent folder to list folders in
monitor - the progress monitor
Throws:
SystemMessageException

listFolders

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

Parameters:
parent - The parent folder to list folders in
fileNameFilter - The name pattern for subsetting the file list when this folder is subsequently expanded
monitor - the progress monitor
Throws:
SystemMessageException

listFiles

IRemoteFile[] listFiles(IRemoteFile parent,
                        IProgressMonitor monitor)
                        throws SystemMessageException
Return a list of all remote files in the given parent folder on the remote system

Parameters:
parent - The parent folder to list files in
monitor - the progress monitor
Throws:
SystemMessageException

listFiles

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

Parameters:
parent - The parent folder to list files in
fileNameFilter - The name pattern to subset the list by, or null to return all files.
monitor - the progress monitor
Throws:
SystemMessageException

listFoldersAndFiles

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

Parameters:
parent - The parent folder to list folders and files in
monitor - the progress monitor
Throws:
SystemMessageException

listFoldersAndFiles

IRemoteFile[] listFoldersAndFiles(IRemoteFile parent,
                                  String fileNameFilter,
                                  IProgressMonitor monitor)
                                  throws SystemMessageException
Return a list of remote folders and files in the given folder. Only file names are subsettable by the given file name filter. It can be null for no subsetting.

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.
monitor - the progress monitor
Throws:
SystemMessageException

listFoldersAndFiles

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

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

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

listFolders

IRemoteFile[] listFolders(IRemoteFile parent,
                          String fileNameFilter,
                          IRemoteFileContext context,
                          IProgressMonitor monitor)
                          throws SystemMessageException
Return a subsetted list of remote folders in the given parent folder on the remote system. This version is called by RemoteFileSubSystemImpl's resolveFilterString(s) 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
monitor - the progress monitor
Throws:
SystemMessageException

listFiles

IRemoteFile[] listFiles(IRemoteFile parent,
                        String fileNameFilter,
                        IRemoteFileContext context,
                        IProgressMonitor monitor)
                        throws SystemMessageException
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
monitor - the progress monitor
Throws:
SystemMessageException

search

void search(IHostSearchResultConfiguration searchConfig)
Given a search configuration, searches for its results.

Parameters:
searchConfig - a search configuration.

cancelSearch

void cancelSearch(IHostSearchResultConfiguration searchConfig)
Given a search configuration, cancel the search.

Parameters:
searchConfig - a search configuration.

getParentFolder

IRemoteFile getParentFolder(IRemoteFile folderOrFile,
                            IProgressMonitor monitor)
Given a folder or file, return its parent folder object.

Parameters:
folderOrFile - folder or file to return parent of.
monitor - the progress monitor
Returns:
the remote file

getParentFolderName

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

Parameters:
folderOrFile - folder or file to return parent of.

supportsEncoding

boolean supportsEncoding()
Returns whether the file subsystem supports encodings. There are file subsystems that deal with codepages and encodings using other mechanisms besides encodings, and such platforms should return false. Other file subsystems may not deal with encodings at all.

Returns:
true if the file subsystem supports encodings, false otherwise.
Since:
2.0

getRemoteEncoding

String getRemoteEncoding()
Returns the encoding of the remote system.

Returns:
the encoding of the remote system.

getRemoteFileObjects

SystemRemoteResourceSet getRemoteFileObjects(List folderOrFileNames,
                                             IProgressMonitor monitor)
                                             throws SystemMessageException
Given a set of fully qualified file or folder names, return an ISystemResourceSet object for it.

Parameters:
folderOrFileNames - Fully qualified folder or file names
monitor - the progress monitor
Returns:
the set of resources
Throws:
SystemMessageException

getRemoteFileObject

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

This may be a long-running operation involving remote system access if the file with the given key is not found in the internal cache.

Parameters:
folderOrFileName - Fully qualified folder or file name.
monitor - the progress monitor
Returns:
the requested IRemoteFile object.
Throws:
SystemMessageException - in case an error occurs contacting the remote system while retrieving the requested remote object.

getRemoteFileObject

IRemoteFile getRemoteFileObject(IRemoteFile parent,
                                String folderOrFileName,
                                IProgressMonitor monitor)
                                throws SystemMessageException
Given a un-qualified file or folder name, and its parent folder object, return an IRemoteFile object for the file.

Parameters:
parent - Folder containing the folder or file
folderOrFileName - Un-qualified folder or file name
monitor - the progress monitor
Returns:
the requested IRemoteFile object
Throws:
SystemMessageException

getRemoteSearchResultObject

IRemoteSearchResult getRemoteSearchResultObject(String key)
                                                throws SystemMessageException
Given a key, returns a search result object for it. For the key, see <

Parameters:
key - the key that uniquely identifies a search result.
Throws:
SystemMessageException

createFile

IRemoteFile createFile(IRemoteFile fileToCreate,
                       IProgressMonitor monitor)
                       throws SystemMessageException
Create a new file, given its IRemoteFile object (these do not have to represent existing files).

  • The parent folder must exist for this to succeed.
  • If this file already exists, this is a no-op.
  • If the given object is a folder, not a file, this is a no-op.

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

createFolder

IRemoteFile createFolder(IRemoteFile folderToCreate,
                         IProgressMonitor monitor)
                         throws SystemMessageException
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.
  • If this folder already exists, this is a no-op.
  • If the given object is a file, not a folder, this is a no-op.

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

createFolders

IRemoteFile createFolders(IRemoteFile folderToCreate,
                          IProgressMonitor monitor)
                          throws SystemMessageException
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.

  • If this folder already exists, this is a no-op.
  • If the given object is a file, not a folder, this is a no-op.

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

delete

boolean delete(IRemoteFile folderOrFile,
               IProgressMonitor monitor)
               throws SystemMessageException
Delete the given remote file or folder.
  • If the input is a folder, that folder must be empty for this to succeed.

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

deleteBatch

boolean deleteBatch(IRemoteFile[] folderOrFiles,
                    IProgressMonitor monitor)
                    throws SystemMessageException
Delete the given batch of remote file or folder.
  • If any of the inputs are a folder, those folders must be empty for this to succeed.
Should throw an exception if some files and folders were deleted and others were not due to an exception during the operation. Without an exception thrown in such cases, views may not be refreshed correctly to account for deleted resources.

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

rename

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

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

move

boolean move(IRemoteFile sourceFolderOrFile,
             IRemoteFile targetFolder,
             String newName,
             IProgressMonitor monitor)
             throws SystemMessageException
Move a file or folder to a new target parent folder.

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

setLastModified

boolean setLastModified(IRemoteFile folderOrFile,
                        long newDate,
                        IProgressMonitor monitor)
                        throws SystemMessageException
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.

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

setReadOnly

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

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

copy

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

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

copyBatch

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

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

download

void download(IRemoteFile source,
              String destination,
              String encoding,
              IProgressMonitor monitor)
              throws SystemMessageException
Get the remote file and save it locally. The file is saved in the encoding specified, with two exceptions:
  • If the remote file is binary, encoding does not apply.
  • If the remote file is a XML file, then it will be copied to local in the encoding specified in the XML declaration, or as determined from the XML specification.

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:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.

upload

void upload(String source,
            IRemoteFile destination,
            String encoding,
            IProgressMonitor monitor)
            throws SystemMessageException
Put the local copy of the remote file back to the remote location. The file is assumed to be in the encoding specified, with two exceptions:
  • If the local file is binary, encoding does not apply.
  • If the local file is a XML file, then it will be copied to remote in the encoding specified in the XML declaration, or as determined from the XML specification.

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

upload

void upload(String source,
            String srcEncoding,
            String remotePath,
            String rmtEncoding,
            IProgressMonitor monitor)
            throws SystemMessageException
Put the local copy of the remote file back to the remote location. The file is assumed to be in the encoding of the local operating system, with two exceptions:
  • If the local file is binary, encoding does not apply.
  • If the local file is a XML file, then it will be copied to remote in the encoding specified in the XML declaration, or as determined from the XML specification.

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

getLanguageUtilityFactory

ILanguageUtilityFactory getLanguageUtilityFactory()
Returns a language utility factory associated with this subsystem.

Returns:
the language utility factory associated with this subsystem.

getUnusedPort

int getUnusedPort()
Returns an unused port number on the remote host that could be used by any tool on the host.

Returns:
an unused port number on the host, or -1 if none could be found.

listRoots

IRemoteFile[] listRoots(IRemoteFileContext context,
                        IProgressMonitor monitor)
                        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

getLocalAddress

InetAddress getLocalAddress()
Returns the TCP/IP address for the local system that is accessible from the remote server. If the local system has multiple IP addresses (because of multiple network cards or VPN), then this will return the address that the remote system can use to "call back" to the PC. There must be a network connection between the local system and the remote system for this method to work. If no network connection exists, then this method returns null.

Returns:
the local TCP/IP address accessible from the remote system, or null if no address can be resolved.

getInputStream

InputStream getInputStream(String remoteParent,
                           String remoteFile,
                           boolean isBinary,
                           IProgressMonitor monitor)
                           throws SystemMessageException
Gets the input stream to access the contents a remote file. Clients should close the input stream when done. Implementations should not return null.

Parameters:
remoteParent - the absolute path of the parent.
remoteFile - the name of the remote file.
isBinary - true if the file is a binary file, false otherwise.
monitor - the progress monitor.
Returns:
the input stream to access the contents of the remote file.
Throws:
SystemMessageException - if an error occurs.
Since:
2.0

getOutputStream

OutputStream getOutputStream(String remoteParent,
                             String remoteFile,
                             boolean isBinary,
                             IProgressMonitor monitor)
                             throws SystemMessageException
Gets the output stream to write to a remote file. Clients should close the output stream when done. Implementations should not return null.

Parameters:
remoteParent - the absolute path of the parent.
remoteFile - the name of the remote file.
isBinary - true if the file is a binary file, false otherwise.
monitor - the progress monitor.
Returns:
the input stream to access the contents of the remote file.
Throws:
SystemMessageException - if an error occurs.
Since:
2.0

RSE
Release 2.0

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