RSE
Release 1.0

org.eclipse.rse.services.files
Class AbstractFileService

java.lang.Object
  extended byorg.eclipse.rse.services.files.AbstractFileService
All Implemented Interfaces:
IFileService, IService
Direct Known Subclasses:
FTPService, LocalFileService, SftpFileService

public abstract class AbstractFileService
extends Object
implements IFileService


Field Summary
static int FILE_TYPE_FILES
           
static int FILE_TYPE_FILES_AND_FOLDERS
           
static int FILE_TYPE_FOLDERS
           
 
Constructor Summary
AbstractFileService()
           
 
Method Summary
 boolean deleteBatch(IProgressMonitor monitor, String[] remoteParents, String[] fileNames)
          Deletes a set of files or folders on the host.
 IHostFile[] getFiles(IProgressMonitor monitor, String remoteParent, String fileFilter)
           
 IHostFile[] getFilesAndFolders(IProgressMonitor monitor, String parentPath, String fileFilter)
           
 IHostFile[] getFolders(IProgressMonitor monitor, String remoteParent, String fileFilter)
           
 SystemMessage getMessage(String messageID)
          Dummy impl for now
protected abstract  IHostFile[] internalFetch(IProgressMonitor monitor, String parentPath, String fileFilter, int fileType)
           
protected  boolean isRightType(int fileType, IHostFile node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.rse.services.files.IFileService
copy, copyBatch, createFile, createFolder, delete, download, getFile, getRoots, getUserHome, isCaseSensitive, move, rename, rename, upload, upload
 
Methods inherited from interface org.eclipse.rse.services.IService
getDescription, getName, initService, uninitService
 

Field Detail

FILE_TYPE_FILES_AND_FOLDERS

public static final int FILE_TYPE_FILES_AND_FOLDERS
See Also:
Constant Field Values

FILE_TYPE_FILES

public static final int FILE_TYPE_FILES
See Also:
Constant Field Values

FILE_TYPE_FOLDERS

public static final int FILE_TYPE_FOLDERS
See Also:
Constant Field Values
Constructor Detail

AbstractFileService

public AbstractFileService()
Method Detail

getFiles

public IHostFile[] getFiles(IProgressMonitor monitor,
                            String remoteParent,
                            String fileFilter)
                     throws SystemMessageException
Specified by:
getFiles in interface IFileService
Parameters:
monitor - the monitor for this potentially long running operation
remoteParent - - the name of the parent directory on the remote file system from which to retrieve the child list.
fileFilter - - a string that can be used to filter the children. Only those files matching the filter make it into the list. The interface does not dictate where the filtering occurs.
Returns:
the list of host files.
Throws:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.

getFolders

public IHostFile[] getFolders(IProgressMonitor monitor,
                              String remoteParent,
                              String fileFilter)
                       throws SystemMessageException
Specified by:
getFolders in interface IFileService
Parameters:
monitor - the monitor for this potentially long running operation
remoteParent - - the name of the parent directory on the remote file system from which to retrieve the child list.
fileFilter - - a string that can be used to filter the children. Only those files matching the filter make it into the list. The interface does not dictate where the filtering occurs.
Returns:
the list of host files.
Throws:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.

getFilesAndFolders

public IHostFile[] getFilesAndFolders(IProgressMonitor monitor,
                                      String parentPath,
                                      String fileFilter)
                               throws SystemMessageException
Specified by:
getFilesAndFolders in interface IFileService
Parameters:
monitor - the monitor for this potentially long running operation
parentPath - - the name of the parent directory on the remote file system from which to retrieve the child list.
fileFilter - - a string that can be used to filter the children. Only those files matching the filter make it into the list. The interface does not dictate where the filtering occurs.
Returns:
the list of host files.
Throws:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.

internalFetch

protected abstract IHostFile[] internalFetch(IProgressMonitor monitor,
                                             String parentPath,
                                             String fileFilter,
                                             int fileType)
                                      throws SystemMessageException
Throws:
SystemMessageException

isRightType

protected boolean isRightType(int fileType,
                              IHostFile node)

getMessage

public SystemMessage getMessage(String messageID)
Dummy impl for now

Specified by:
getMessage in interface IService

deleteBatch

public boolean deleteBatch(IProgressMonitor monitor,
                           String[] remoteParents,
                           String[] fileNames)
                    throws SystemMessageException
Description copied from interface: IFileService
Deletes a set of files or folders on the host. Should throw an exception if some files and folders were deleted and others were not due to an exception during the operation. Without an exception thrown in such cases, views may not be refreshed correctly to account for deleted resources.

Specified by:
deleteBatch in interface IFileService
Parameters:
monitor - the progress monitor
remoteParents - the array of folders containing the files to delete
fileNames - the names of the files or folders to delete
Returns:
true iff all deletes are successful
Throws:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.

RSE
Release 1.0

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