Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.services.ifs.files
Class IFSFileService

java.lang.Object
  extended by AbstractFileService
      extended by com.ibm.etools.iseries.services.ifs.files.IFSFileService
All Implemented Interfaces:
IIFSFileService

public class IFSFileService
extends AbstractFileService
implements IIFSFileService


Field Summary
static int BUFFER_SIZE
           
static String copyright
           
static int KB_IN_BYTES
           
static int NUM_OF_KB
           
 
Constructor Summary
IFSFileService(IToolboxSessionProvider toolboxProvider)
           
 
Method Summary
protected  IHostFile[] convertToHostFiles(IFSFile[] list, int type)
           
 void copy(String srcParent, String srcName, String tgtParent, String tgtName, IProgressMonitor monitor)
           
 void copyBatch(String[] srcParents, String[] srcNames, String tgtParent, IProgressMonitor monitor)
           
 IHostFile createFile(String remoteParent, String fileName, IProgressMonitor monitor)
           
 IHostFile createFolder(String remoteParent, String folderName, IProgressMonitor monitor)
           
 void delete(String remoteParent, String fileName, IProgressMonitor monitor)
           
 void download(String remoteParent, String remoteFile, File localFile, boolean isBinary, String hostEncoding, IProgressMonitor monitor)
           
 String getCurrentDirectory()
          Get the current directory for this connection
 String getDescription()
           
 String getEncoding(IProgressMonitor monitor)
           
 IHostFile getFile(String remoteParent, String name, IProgressMonitor monitor)
           
 InputStream getInputStream(String remoteParent, String remoteFile, boolean isBinary, IProgressMonitor monitor)
           
 String getName()
           
 OutputStream getOutputStream(String remoteParent, String remoteFile, int options, IProgressMonitor monitor)
           
 IHostFile[] getRoots(IProgressMonitor monitor)
           
 IHostFile getUserHome()
           
 void initService(IProgressMonitor monitor)
           
protected  IHostFile[] internalFetch(String parentPath, String fileFilter, int fileType, IProgressMonitor monitor)
           
 boolean isCaseSensitive()
           
 void move(String srcParent, String srcName, String tgtParent, String tgtName, IProgressMonitor monitor)
           
 void rename(String remoteParent, String oldName, String newName, IHostFile oldFile, IProgressMonitor monitor)
           
 void rename(String remoteParent, String oldName, String newName, IProgressMonitor monitor)
           
 void setLastModified(String parent, String name, long timestamp, IProgressMonitor monitor)
           
 void setReadOnly(String parent, String name, boolean readOnly, IProgressMonitor monitor)
           
 void setSequenceNumberStrip(boolean shouldStrip)
          Set boolean flag for stripping sequence number or not.
 boolean shouldStripSequenceNumber()
          Return true if sequence number should be stripped, false otherwise.
 boolean supportsEncodingConversion()
           
 void uninitService(IProgressMonitor monitor)
           
 void upload(File localFile, String remoteParent, String remoteFile, boolean isBinary, String srcEncoding, String hostEncoding, IProgressMonitor monitor)
           
protected  boolean upload(InputStream stream, long srcBytes, String remoteParent, String remoteFile, boolean isBinary, String srcEncoding, String hostEncoding, IProgressMonitor monitor, int sequenceState)
          Copy a file from local to the remote file system.
 void upload(InputStream stream, String remoteParent, String remoteFile, boolean isBinary, String hostEncoding, IProgressMonitor monitor)
           
 void uploadMultiple(File[] localFiles, String[] remoteParents, String[] remoteFiles, boolean[] isBinaries, String[] srcEncodings, String[] hostEncodings, IProgressMonitor monitor)
           
 
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

KB_IN_BYTES

public static final int KB_IN_BYTES
See Also:
Constant Field Values

NUM_OF_KB

public static final int NUM_OF_KB
See Also:
Constant Field Values

BUFFER_SIZE

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

IFSFileService

public IFSFileService(IToolboxSessionProvider toolboxProvider)
Method Detail

copy

public void copy(String srcParent,
                 String srcName,
                 String tgtParent,
                 String tgtName,
                 IProgressMonitor monitor)
          throws SystemMessageException
Throws:
SystemMessageException

copyBatch

public void copyBatch(String[] srcParents,
                      String[] srcNames,
                      String tgtParent,
                      IProgressMonitor monitor)
               throws SystemMessageException
Throws:
SystemMessageException

createFile

public IHostFile createFile(String remoteParent,
                            String fileName,
                            IProgressMonitor monitor)
                     throws SystemMessageException
Throws:
SystemMessageException

createFolder

public IHostFile createFolder(String remoteParent,
                              String folderName,
                              IProgressMonitor monitor)
                       throws SystemMessageException
Throws:
SystemMessageException

delete

public void delete(String remoteParent,
                   String fileName,
                   IProgressMonitor monitor)
            throws SystemMessageException
Throws:
SystemMessageException

download

public void download(String remoteParent,
                     String remoteFile,
                     File localFile,
                     boolean isBinary,
                     String hostEncoding,
                     IProgressMonitor monitor)
              throws SystemMessageException
Throws:
SystemMessageException

getEncoding

public String getEncoding(IProgressMonitor monitor)
                   throws SystemMessageException
Throws:
SystemMessageException

getFile

public IHostFile getFile(String remoteParent,
                         String name,
                         IProgressMonitor monitor)
                  throws SystemMessageException
Throws:
SystemMessageException

getInputStream

public InputStream getInputStream(String remoteParent,
                                  String remoteFile,
                                  boolean isBinary,
                                  IProgressMonitor monitor)
                           throws SystemMessageException
Throws:
SystemMessageException

getOutputStream

public OutputStream getOutputStream(String remoteParent,
                                    String remoteFile,
                                    int options,
                                    IProgressMonitor monitor)
                             throws SystemMessageException
Throws:
SystemMessageException

getRoots

public IHostFile[] getRoots(IProgressMonitor monitor)
                     throws SystemMessageException
Throws:
SystemMessageException

getUserHome

public IHostFile getUserHome()

isCaseSensitive

public boolean isCaseSensitive()

move

public void move(String srcParent,
                 String srcName,
                 String tgtParent,
                 String tgtName,
                 IProgressMonitor monitor)
          throws SystemMessageException
Throws:
SystemMessageException

rename

public void rename(String remoteParent,
                   String oldName,
                   String newName,
                   IProgressMonitor monitor)
            throws SystemMessageException
Throws:
SystemMessageException

rename

public void rename(String remoteParent,
                   String oldName,
                   String newName,
                   IHostFile oldFile,
                   IProgressMonitor monitor)
            throws SystemMessageException
Throws:
SystemMessageException

setLastModified

public void setLastModified(String parent,
                            String name,
                            long timestamp,
                            IProgressMonitor monitor)
                     throws SystemMessageException
Throws:
SystemMessageException

setReadOnly

public void setReadOnly(String parent,
                        String name,
                        boolean readOnly,
                        IProgressMonitor monitor)
                 throws SystemMessageException
Throws:
SystemMessageException

supportsEncodingConversion

public boolean supportsEncodingConversion()

upload

public void upload(InputStream stream,
                   String remoteParent,
                   String remoteFile,
                   boolean isBinary,
                   String hostEncoding,
                   IProgressMonitor monitor)
            throws SystemMessageException
Throws:
SystemMessageException

upload

protected boolean upload(InputStream stream,
                         long srcBytes,
                         String remoteParent,
                         String remoteFile,
                         boolean isBinary,
                         String srcEncoding,
                         String hostEncoding,
                         IProgressMonitor monitor,
                         int sequenceState)
                  throws SystemMessageException
Copy a file from local to the remote file system. The remote target is denoted by a string representing the parent and a string representing the file.

Parameters:
localFile - - a real file in the local file system.
scrBytes - - the total bytes of source
remoteParent - - a string designating the parent folder of the target for this file.
remoteFile - - a string designating the name of the file to be written on the remote system.
isBinary - - indicates whether the file is text or binary
srcEncoding - - the src encoding of the file (if text)
hostEncoding - - the tgt encoding of the file (if text)
monitor - - the monitor for this potentially long running operation
sequenceState - - the state of sequence number in file content
Returns:
true if the file was uploaded
Throws:
SystemMessageException - if an error occurs. Typically this would be one of those in the RemoteFileException family.

upload

public void upload(File localFile,
                   String remoteParent,
                   String remoteFile,
                   boolean isBinary,
                   String srcEncoding,
                   String hostEncoding,
                   IProgressMonitor monitor)
            throws SystemMessageException
Throws:
SystemMessageException

uploadMultiple

public void uploadMultiple(File[] localFiles,
                           String[] remoteParents,
                           String[] remoteFiles,
                           boolean[] isBinaries,
                           String[] srcEncodings,
                           String[] hostEncodings,
                           IProgressMonitor monitor)
                    throws SystemMessageException
Throws:
SystemMessageException

getDescription

public String getDescription()

getName

public String getName()

initService

public void initService(IProgressMonitor monitor)

uninitService

public void uninitService(IProgressMonitor monitor)

internalFetch

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

convertToHostFiles

protected IHostFile[] convertToHostFiles(IFSFile[] list,
                                         int type)
                                  throws SystemMessageException
Throws:
SystemMessageException

shouldStripSequenceNumber

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


setSequenceNumberStrip

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

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

getCurrentDirectory

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

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.