Integrated file system

The integrated file system classes allow a Java program to access files in the integrated file system of an iSeries or AS/400e server as a stream of bytes or a stream of characters. The integrated file system classes were created because the java.io package does not provide file redirection and other iSeries functionality.

The function that is provided by the IFSFile classes is a superset of the function provided by the file IO classes in the java.io package. All methods in java.io FileInputStream, FileOutputStream, and RandomAccessFile are in the integrated file system classes.

In addition to these methods, the classes contain methods to do the following:

Through the integrated file system classes, the Java program can directly access stream files on the iSeries. The Java program can still use the java.io package, but the client operating system must then provide a method of redirection. For example, if the Java program is running on a Windows 95 or Windows NT operating system, the Network Drives function of iSeries Access for Windows is required to redirect java.io calls to the iSeries. With the integrated file system classes, you do not need iSeries Access for Windows.

A required parameter of the integrated file system classes is the AS400 object that represents the iSeries system that contains the file. Using the integrated file system classes causes the AS400 object to connect to the iSeries. See managing connections for information about managing connections.

The integrated file system classes require the hierarchical name of the object in the integrated file system. Use the forward slash as the path separator character. The following example shows how to access FILE1 in directory path DIR1/DIR2:

     /DIR1/DIR2/FILE1

The integrated file system classes are as follows.

Integrated file system class Description
IFSFile Represents a file in the integrated file system
IFSJavaFile Represents a file in the integrated file system (extends java.io.File)
IFSFileInputStream Represents an input stream for reading data from an iSeries file
IFSTextFileInputStream Represents a stream of character data read from a file
IFSFileOutputStream Represents an output stream for writing data to an iSeries file
IFSTextFileOutputStream Represents a stream of character data being written to a file
IFSRandomAccessFile Represents a file on the iSeries for reading and writing data
IFSFileDialog Allows the user to move within the file system and to select a file within the file system

Examples

The IFSCopyFile example shows how to use the integrated file system classes to copy a file from one directory to another on the iSeries.

The File List Example shows how to use the integrated file system classes to list the contents of a directory on the iSeries.