Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.subsystems.ifs.files
Class IFSFileServiceSubSystem

java.lang.Object
  extended by FileServiceSubSystem
      extended by com.ibm.etools.iseries.subsystems.ifs.files.IFSFileServiceSubSystem
All Implemented Interfaces:
IISeriesSubSystem

public class IFSFileServiceSubSystem
extends FileServiceSubSystem
implements IISeriesSubSystem

Define a FileServiceSubSystem which implements IToolboxSubsystem interface.


Field Summary
static String copyright
           
 
Constructor Summary
IFSFileServiceSubSystem(IHost host, IConnectorService connectorService, IFileService hostFileService, IHostFileToRemoteFileAdapter fileAdapter, ISearchService searchService)
          Constructor.
 
Method Summary
protected  boolean checkStripSequenceNumber(String source, String remotePath, String remoteFileName)
          Check if we need to strip sequence number or not on a given local file.
protected  boolean checkUserDecision(String source, String remotePath, String remoteFileName)
          Return true if user chooses to strip the sequence number, false otherwise.
 void copy(IRemoteFile sourceFolderOrFile, IRemoteFile targetFolder, String newName, IProgressMonitor monitor)
          
 void copyBatch(IRemoteFile[] sourceFolderOrFiles, IRemoteFile targetFolder, IProgressMonitor monitor)
          
 IRemoteFile createFile(IRemoteFile fileToCreate, IProgressMonitor monitor)
           
 void download(IRemoteFile file, String localpath, String encoding, IProgressMonitor monitor)
           
 IFSCacheHandler getCacheHandler()
          Returns cache handler for this subsystem
 ISubSystem getCmdSubSystem()
          Return the command subsystem ("iSeries Commands") for executing remote QSYS commands
 String getCurrentDirectory()
          Get the current directory for this connection
 boolean getHeadlessUserDecisionForTest(String source, String remotePath)
          Return user choice
 ISubSystem getIFSCmdSubSystem()
           
 ISubSystem getObjectSubSystem()
          Return the objects subsystem ("iSeries Objects") for accessing remote QSYS libs, objs, mbrs, etc.
 Object getObjectWithAbsoluteName(String key, IProgressMonitor monitor)
           
 IRemoteFile getRemoteFileObject(String folderOrFileName, IProgressMonitor monitor)
          Constructs and returns an IRemoteFile object given a fully-qualified file or folder name.
 IRemoteFile[] getRemoteFileObjects(String[] folderOrFileNames, IProgressMonitor monitor)
           
protected  void initUploadMultiple(int uploadFileNumber)
          Initialize state variables before uploading multiple files for sequence checking.
protected  Object[] internalResolveFilterString(String filterString, IProgressMonitor monitor)
          Actually resolve an absolute filter string.
protected  boolean isPromptNeededFromPreferenceSetting(String source)
          Whether or not the user should be prompted before uploading this file using the internal sequence numbers
 void move(IRemoteFile sourceFolderOrFile, IRemoteFile targetFolder, String newName, IProgressMonitor monitor)
          
 void setHeadlessModeForTest(boolean headlessMode)
          Set if we need to get user input from UI.
 void setHeadlessUserDecisionForTest(boolean headlessUserChoice)
          Set user choice.
 void setShouldSequenceNumberStrip(boolean shouldStrip)
          Set boolean flag for stripping sequence number or not.
 boolean shouldStripSequenceNumber()
          Return true if sequence number should be stripped, false otherwise.
 boolean supportsEncoding()
           
 void upload(String source, IRemoteFile destination, String encoding, IProgressMonitor monitor)
           
 void upload(String source, String srcEncoding, String remotePath, String rmtEncoding, IProgressMonitor monitor)
           
 void uploadMultiple(String[] sources, IRemoteFile[] destinations, String[] encodings, IProgressMonitor monitor)
           
 void uploadMultiple(String[] sources, String[] srcEncodings, String[] remotePaths, String[] rmtEncodings, IProgressMonitor monitor)
           
protected  boolean uploadWithSequenceNumberChecking(String source, String remoteParentPath, String remoteFileName, boolean isBinary, String srcEncoding, String rmtEncoding, IProgressMonitor monitor)
          Upload file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static String copyright
Constructor Detail

IFSFileServiceSubSystem

public IFSFileServiceSubSystem(IHost host,
                               IConnectorService connectorService,
                               IFileService hostFileService,
                               IHostFileToRemoteFileAdapter fileAdapter,
                               ISearchService searchService)
Constructor.

Parameters:
host -
connectorService -
hostFileService -
fileAdapter -
searchService -
Method Detail

supportsEncoding

public boolean supportsEncoding()

getRemoteFileObject

public IRemoteFile getRemoteFileObject(String folderOrFileName,
                                       IProgressMonitor monitor)
                                throws SystemMessageException
Constructs and returns an IRemoteFile object given a fully-qualified file or folder name.

Parameters:
folderOrFileName - Fully qualified folder or file name
monitor - the progress monitor
Returns:
The constructed IRemoteFile
Throws:
SystemMessageException
See Also:
IRemoteFile

internalResolveFilterString

protected Object[] internalResolveFilterString(String filterString,
                                               IProgressMonitor monitor)
                                        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.

Throws:
InvocationTargetException
InterruptedException
See Also:
org.eclipse.rse.core.subsystems.SubSystem#internalResolveFilterString(String,IProgressMonitor)

shouldStripSequenceNumber

public boolean shouldStripSequenceNumber()
Return true if sequence number should be stripped, false otherwise.


setShouldSequenceNumberStrip

public void setShouldSequenceNumberStrip(boolean shouldStrip)
Set boolean flag for stripping sequence number or not.

Parameters:
stripSequenceNumber: - true to strip the sequence number, false otherwise.

upload

public void upload(String source,
                   String srcEncoding,
                   String remotePath,
                   String rmtEncoding,
                   IProgressMonitor monitor)
            throws SystemMessageException
Throws:
SystemMessageException

uploadWithSequenceNumberChecking

protected boolean uploadWithSequenceNumberChecking(String source,
                                                   String remoteParentPath,
                                                   String remoteFileName,
                                                   boolean isBinary,
                                                   String srcEncoding,
                                                   String rmtEncoding,
                                                   IProgressMonitor monitor)
                                            throws SystemMessageException
Upload file. If the file has sequence number, prompt user for stripping the sequence number or not according to preference setting..

Parameters:
source: - the absolute path of the local copy
remoteParentPath: - remote parent path
remoteFileName: - remote file name
isBinary: - is binary or not
srcEncoding: - source encoding
rmtEncoding: - remote encoding
monitor: - IProgressMonitor object
Returns:
True if sequence numbers are be stripped during upload, False if otherwise
Throws:
SystemMessageException

uploadMultiple

public void uploadMultiple(String[] sources,
                           IRemoteFile[] destinations,
                           String[] encodings,
                           IProgressMonitor monitor)
                    throws SystemMessageException
Throws:
SystemMessageException

uploadMultiple

public void uploadMultiple(String[] sources,
                           String[] srcEncodings,
                           String[] remotePaths,
                           String[] rmtEncodings,
                           IProgressMonitor monitor)
                    throws SystemMessageException
Throws:
SystemMessageException

initUploadMultiple

protected void initUploadMultiple(int uploadFileNumber)
Initialize state variables before uploading multiple files for sequence checking.

Parameters:
uploadFileNumber: - the number of files to be uploaded

checkStripSequenceNumber

protected boolean checkStripSequenceNumber(String source,
                                           String remotePath,
                                           String remoteFileName)
Check if we need to strip sequence number or not on a given local file.

Parameters:
source: - the absolute path of the local copy
remotePath: - remote path
remoteFileName: - remote file name
Returns:
true if we need to strip sequence number, false otherwise.

checkUserDecision

protected boolean checkUserDecision(String source,
                                    String remotePath,
                                    String remoteFileName)
Return true if user chooses to strip the sequence number, false otherwise.

Parameters:
source: - the absolute path of the local copy
remotePath: - remote path
remoteFileName: - remote file name
Returns:
true if we need to strip sequence number, false otherwise.

isPromptNeededFromPreferenceSetting

protected boolean isPromptNeededFromPreferenceSetting(String source)
Whether or not the user should be prompted before uploading this file using the internal sequence numbers

Parameters:
fileName - the file name
Returns:
true if the filename required the user to be prompted, false otherwise
Since:
7.0

upload

public void upload(String source,
                   IRemoteFile destination,
                   String encoding,
                   IProgressMonitor monitor)
            throws SystemMessageException
Throws:
SystemMessageException

setHeadlessModeForTest

public void setHeadlessModeForTest(boolean headlessMode)
Set if we need to get user input from UI.


getHeadlessUserDecisionForTest

public boolean getHeadlessUserDecisionForTest(String source,
                                              String remotePath)
Return user choice


setHeadlessUserDecisionForTest

public void setHeadlessUserDecisionForTest(boolean headlessUserChoice)
Set user choice.


download

public void download(IRemoteFile file,
                     String localpath,
                     String encoding,
                     IProgressMonitor monitor)
              throws SystemMessageException
Throws:
SystemMessageException

copy

public void copy(IRemoteFile sourceFolderOrFile,
                 IRemoteFile targetFolder,
                 String newName,
                 IProgressMonitor monitor)
          throws SystemMessageException

Throws:
SystemMessageException
Since:
3.0 returns void

copyBatch

public void copyBatch(IRemoteFile[] sourceFolderOrFiles,
                      IRemoteFile targetFolder,
                      IProgressMonitor monitor)
               throws SystemMessageException

Throws:
SystemMessageException
Since:
3.0 returns void

move

public void move(IRemoteFile sourceFolderOrFile,
                 IRemoteFile targetFolder,
                 String newName,
                 IProgressMonitor monitor)
          throws SystemMessageException

Throws:
SystemMessageException
Since:
3.0 returns void

getIFSCmdSubSystem

public ISubSystem getIFSCmdSubSystem()

getCurrentDirectory

public String getCurrentDirectory()
                           throws SystemMessageException
Get the current directory for this connection

Throws:
SystemMessageException

getCacheHandler

public IFSCacheHandler getCacheHandler()
Returns cache handler for this subsystem


getCmdSubSystem

public ISubSystem getCmdSubSystem()
Description copied from interface: IISeriesSubSystem
Return the command subsystem ("iSeries Commands") for executing remote QSYS commands

Specified by:
getCmdSubSystem in interface IISeriesSubSystem

getObjectSubSystem

public ISubSystem getObjectSubSystem()
Description copied from interface: IISeriesSubSystem
Return the objects subsystem ("iSeries Objects") for accessing remote QSYS libs, objs, mbrs, etc. For historical reasons, this is also known as the "file subsystem".

Specified by:
getObjectSubSystem in interface IISeriesSubSystem

getObjectWithAbsoluteName

public Object getObjectWithAbsoluteName(String key,
                                        IProgressMonitor monitor)
                                 throws Exception
Throws:
Exception

createFile

public IRemoteFile createFile(IRemoteFile fileToCreate,
                              IProgressMonitor monitor)
                       throws SystemMessageException
Throws:
SystemMessageException

getRemoteFileObjects

public IRemoteFile[] getRemoteFileObjects(String[] folderOrFileNames,
                                          IProgressMonitor monitor)
                                   throws SystemMessageException
Throws:
SystemMessageException

Rational Developer for Power Systems Software
V7.6

Copyright © 2011 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.