Integrated file system

The integrated file system classes allow a Java™ program to access files in the integrated file system of an iSeries™ 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, 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

Integrated file system classes

The following table lists the integrated file system classes:

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 (deprecated)
Start of changeIFSFileReaderEnd of change Start of changeUse this class for reading character files in the integrated file system.End of change
IFSFileOutputStream Represents an output stream for writing data to an iSeries file
Start of changeIFSFileWriterEnd of change Start of changeUse IFSFileWriter for writing character files in the integrated file system.End of change
IFSTextFileOutputStream Represents a stream of character data being written to a file (deprecated)
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
Start of changeIFSSystemViewEnd of change Start of changeIFSSystemView provides a gateway to the iSeries integrated file system, for use when constructing javax.swing.JFileChooser objects.End of change

Examples: Using integrated file system classes

Example: Using IFS classes to copy a file from one directory to another shows how to use the integrated file system classes to copy a file from one directory to another on the iSeries.

Example: Using the IFS classes to list the contents of a directory shows how to use the integrated file system classes to list the contents of a directory on the iSeries.