| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.xbus.technical.as400.AS400FileBase
public abstract class AS400FileBase
Class AS400FileBase is the abstract base class for the
 AS400FileReceiver and AS400FileSender classes.
 
It provides the methods for the following:
| Field Summary | |
|---|---|
| protected  com.ibm.as400.access.CharConverter | mConverterThe char converter according to actual string encoding. | 
| Constructor Summary | |
|---|---|
| AS400FileBase() | |
| Method Summary | |
|---|---|
| protected  void | callAS400Program(com.ibm.as400.access.AS400 as400,
                 java.lang.String programName,
                 com.ibm.as400.access.ProgramParameter[] parameters,
                 int timeout)Calls an AS400 program. | 
| protected  void | copyFile(com.ibm.as400.access.AS400 as400System,
         java.lang.String sourceName,
         java.lang.String targetName)This method uses the installable file system classes to copy a file from one directory to another on the server. | 
| protected  void | deleteFile(com.ibm.as400.access.AS400 mAS400System,
           java.lang.String fileName)deleteFiledeletes a file on the AS400 file system. | 
| protected  void | deleteMember(com.ibm.as400.access.AS400 as400System,
             java.lang.String fileName)Deletes a member of a sequential file on the AS/400 file system. | 
| static java.lang.String | getEncoding(com.ibm.as400.access.AS400 as400System,
            java.lang.String system)Returns the encoding of the data type from the Configuration. | 
| protected  java.lang.String | getRenamedMember(com.ibm.as400.access.QSYSObjectPathName qsysPathname,
                 java.lang.String newMember)Return a path name with a new member name. | 
| protected  void | releaseLock(com.ibm.as400.access.AS400 as400System,
            java.lang.String lockFilename)Releases all locks acquired via the setLock(AS400, String)method. | 
| protected  void | renameFile(com.ibm.as400.access.AS400 as400System,
           java.lang.String sourceFilename,
           java.lang.String destFilename)Renames the integrated file system object specified by the source path name to have the path name of dest. | 
| protected  void | setLock(com.ibm.as400.access.AS400 as400System,
        java.lang.String lockFilename)Sets a lock on the file to prevent other users from accessing the file while it is in use. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected com.ibm.as400.access.CharConverter mConverter
protected to grant access by the subclasses.
| Constructor Detail | 
|---|
public AS400FileBase()
| Method Detail | 
|---|
public static java.lang.String getEncoding(com.ibm.as400.access.AS400 as400System,
                                           java.lang.String system)
                                    throws XException
Configuration. If this one is
 non-existent, the method returns the default value from the AS400 object
 that corresponds to the job CCSID of the server.
 
as400System - AS400 object for the server that holds the filessystem - system name for which encoding must be read
XException - if encoding cannot be determined neither from the
                configurationnor by accesing the AS400
protected void setLock(com.ibm.as400.access.AS400 as400System,
                       java.lang.String lockFilename)
                throws XException
The following type of lock is used:
 WRITE_EXCLUSIVE_LOCK   The current Java
 program changes the file, and no other program can access the file.
 
Note: If a lock has already been obtained for this file, no action is taken.
as400System - The AS400 system to which to connect. The system
            cannot be null.lockFilename - The integrated file system pathname of the file to be
            locked. The name cannot be null.
XException - if locking did not work
protected void releaseLock(com.ibm.as400.access.AS400 as400System,
                           java.lang.String lockFilename)
                    throws XException
setLock(AS400, String)
 method.
 If no locks have been explicitly obtained, no action is taken.
as400System - The AS400 system to which to connect. The system
            cannot be null.lockFilename - The integrated file system pathname of the file to be
            locked. The name cannot be null.
XException - if the file lock can not be released
protected java.lang.String getRenamedMember(com.ibm.as400.access.QSYSObjectPathName qsysPathname,
                                            java.lang.String newMember)
 For example:
 
This method parses the given QSYSObjectPathName object to extract the library, object, member, and object type and builds integrated file system path name with new member as follows:
qsysPathname - represents old object in the QSYS library file systemnewMember - new member name, cannot exceed 10 characters in length!
            Must start with a letter.
protected void renameFile(com.ibm.as400.access.AS400 as400System,
                          java.lang.String sourceFilename,
                          java.lang.String destFilename)
                   throws XException
as400System - AS400 system to which to connect. The system cannot be
            nullsourceFilename - old abstract pathname of the integrated file system
            objectdestFilename - new abstract pathname of the integrated file system
            object
XException - if an error occurs while communicating with the
                server.
protected void copyFile(com.ibm.as400.access.AS400 as400System,
                        java.lang.String sourceName,
                        java.lang.String targetName)
                 throws XException
as400System - AS400 object for the server which holds the files.sourceName - name the source file to be copiedtargetName - name the target file to be copied to
XException - if file processing cannot be completed
protected void deleteFile(com.ibm.as400.access.AS400 mAS400System,
                          java.lang.String fileName)
                   throws XException
deleteFile deletes a file on the AS400 file system. This
 method is used for files in the AS400 inegrated file system sense.
mAS400System - the AS400 to interact withfileName - the path of the file to delete
XException - if the file cannot be deleted for any reasondeleteMember(AS400, String)
protected void deleteMember(com.ibm.as400.access.AS400 as400System,
                            java.lang.String fileName)
                     throws XException
as400System - the AS/400 to interact withfileName - the name of the file and member to delete
XException - if the member cannot be deleted for any reason
protected void callAS400Program(com.ibm.as400.access.AS400 as400,
                                java.lang.String programName,
                                com.ibm.as400.access.ProgramParameter[] parameters,
                                int timeout)
                         throws XException
as400 - the AS400 to interact withprogramName - the path of the program to callparameters - the input and output paremeters of the program calltimeout - seconds before program will be stopped
XException - if the AS400 issues an error| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||