Class RIFSFileList
- java.lang.Object
-
- com.ibm.as400.resource.ResourceList
-
- com.ibm.as400.resource.RIFSFileList
-
- All Implemented Interfaces:
- java.io.Serializable
Deprecated.UseIFSFile
instead, as this package may be removed in the future.
public class RIFSFileList extends ResourceList
The RIFSFileList class represents a list of files and directories in the integrated file system. This class provides function similar toIFSFile
andIFSJavaFile
except that it is a subclass ofResourceList
. As a result, it can be used directly in conjunction with components written for ResourceList objects.If the specified directory does not exist, the list will be empty.
The contents of the list are always loaded sequentially, regardless of the order that you request them. In addition, they are loaded on demand, meaning the entire list is not loaded until the last item is requested. Use the
resourceAt()
method to request a particular list item. If that list item is not yet loaded, resourceAt() returns null. To ensure that a particular list item is loaded, callwaitForResource()
. To ensure that the entire list is loaded, callwaitForComplete()
. Note that both wait methods will block until the requested resource(s) are loaded.The following selection IDs are supported:
Use one or more of these selection IDs with
getSelectionValue()
andsetSelectionValue()
to access the selection values for an RIFSFileList.RIFSFileList objects generate
RIFSFile
objects.// Create an RIFSFileList object to represent a list of files. AS400 system = new AS400("MYSYSTEM", "MYUSERID", "MYPASSWORD"); RIFSFileList fileList = new RIFSFileList(system, "/home/myuserid");
// Set the selection so that only Java source files are listed. fileList.setSelectionValue(RIFSFileList.PATTERN, "*.java");
// Open the list and get the first 50 items. fileList.open(); fileList.waitForResource(50);
// Read and print the file names and last modified dates // for the first 50 items in the list. for(long i = 0; i < 50; ++i) { RIFSFile file = (RIFSFile)fileList.resourceAt(i); System.out.println(file.getAttributeValue(RIFSFile.NAME)); System.out.println(file.getAttributeValue(RIFSFile.LAST_MODIFIED)); System.out.println(); }
// Close the list. fileList.close();- See Also:
RIFSFile
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
FILTER
Deprecated.Selection ID for filter.static java.lang.String
PATTERN
Deprecated.Selection ID for pattern.
-
Constructor Summary
Constructors Constructor and Description RIFSFileList()
Deprecated.Constructs an RIFSFileList object.RIFSFileList(AS400 system, java.lang.String path)
Deprecated.Constructs an RIFSFileList object.RIFSFileList(RIFSFile file)
Deprecated.Constructs an RIFSFileList object.
-
Method Summary
Methods Modifier and Type Method and Description protected void
establishConnection()
Deprecated.Establishes the connection to the system.protected void
freezeProperties()
Deprecated.Freezes any property changes.java.lang.String
getPath()
Deprecated.Returns the directory path.void
open()
Deprecated.Opens the list.void
refreshContents()
Deprecated.Refreshes the contents of the list.Resource
resourceAt(long index)
Deprecated.Returns the resource specified by the index.void
setPath(java.lang.String path)
Deprecated.Sets the directory path.void
waitForComplete()
Deprecated.Waits until the list is completely loaded.void
waitForResource(long index)
Deprecated.Waits until the resource is available or the list is complete.-
Methods inherited from class com.ibm.as400.resource.ResourceList
addActiveStatusListener, addPropertyChangeListener, addResourceListListener, addVetoableChangeListener, arePropertiesFrozen, close, fireBusy, fireIdle, fireLengthChanged, fireListClosed, fireListCompleted, fireListInError, fireListOpened, firePropertyChange, fireResourceAdded, fireVetoableChange, getAttributeMetaData, getAttributeMetaData, getListLength, getPresentation, getSelectionMetaData, getSelectionMetaData, getSelectionValue, getSelectionValue, getSortMetaData, getSortMetaData, getSortOrder, getSortValue, getSystem, isBidiEnabled, isComplete, isConnectionEstablished, isInError, isOpen, isResourceAvailable, refreshStatus, removeActiveStatusListener, removePropertyChangeListener, removeResourceListListener, removeVetoableChangeListener, resources, setAttributeMetaData, setPresentation, setSelectionValue, setSelectionValue, setSortOrder, setSortValue, setSystem, toString
-
-
-
-
Field Detail
-
FILTER
public static final java.lang.String FILTER
Deprecated.Selection ID for filter. This identifies anIFSFileFilter
selection, which represents the filter used to select which files are included in the list.- See Also:
- Constant Field Values
-
PATTERN
public static final java.lang.String PATTERN
Deprecated.Selection ID for pattern. This identifies a String selection, which represents the pattern used to select which files are included in the list. This value can include wildcards (*) and question marks (?).- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RIFSFileList
public RIFSFileList()
Deprecated.Constructs an RIFSFileList object.
-
RIFSFileList
public RIFSFileList(AS400 system, java.lang.String path)
Deprecated.Constructs an RIFSFileList object.- Parameters:
system
- The system.path
- The directory path.
-
RIFSFileList
public RIFSFileList(RIFSFile file)
Deprecated.Constructs an RIFSFileList object.- Parameters:
file
- The directory.
-
-
Method Detail
-
establishConnection
protected void establishConnection() throws ResourceException
Deprecated.Establishes the connection to the system.The method is called by the resource framework automatically when the connection needs to be established.
- Overrides:
establishConnection
in classResourceList
- Throws:
ResourceException
- If an error occurs.
-
freezeProperties
protected void freezeProperties() throws ResourceException
Deprecated.Freezes any property changes. After this is called, property changes should not be made. Properties are not the same thing as attributes. Properties are basic pieces of information which must be set to make the object usable, such as the system and the name.The method is called by the resource framework automatically when the properties need to be frozen.
- Overrides:
freezeProperties
in classResourceList
- Throws:
ResourceException
- If an error occurs.
-
getPath
public java.lang.String getPath()
Deprecated.Returns the directory path.- Returns:
- The directory path.
-
open
public void open() throws ResourceException
Deprecated.Opens the list. The list must be open in order to perform most operations. This method has no effect if the list is already opened.- Overrides:
open
in classResourceList
- Throws:
ResourceException
- If an error occurs.
-
refreshContents
public void refreshContents() throws ResourceException
Deprecated.Refreshes the contents of the list.This will implicitly open the list if needed.
- Overrides:
refreshContents
in classResourceList
- Throws:
ResourceException
- If an error occurs.
-
resourceAt
public Resource resourceAt(long index) throws ResourceException
Deprecated.Returns the resource specified by the index.This will implicitly open the list if needed.
- Overrides:
resourceAt
in classResourceList
- Parameters:
index
- The index.- Returns:
- The resource specified by the index, or null if the resource is not yet available.
- Throws:
ResourceException
- If an error occurs.
-
setPath
public void setPath(java.lang.String path)
Deprecated.Sets the directory path. This does not change the directory on the system. Instead, it changes the directory to which this object references. This cannot be changed if the object has established a connection to the system.- Parameters:
path
- The directory path.
-
waitForComplete
public void waitForComplete() throws ResourceException
Deprecated.Waits until the list is completely loaded.This will implicitly open the list if needed.
- Overrides:
waitForComplete
in classResourceList
- Throws:
ResourceException
- If an error occurs.
-
waitForResource
public void waitForResource(long index) throws ResourceException
Deprecated.Waits until the resource is available or the list is complete. This waits until all resources up to and including the specified resource are loaded.This will implicitly open the list if needed.
- Overrides:
waitForResource
in classResourceList
- Parameters:
index
- The index.- Throws:
ResourceException
- If an error occurs.
-
-