IFSFile
instead, as this package may be removed in the future.public class RIFSFileList extends ResourceList
IFSFile
and
IFSJavaFile
except that it is a subclass of
ResourceList
. 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, call waitForResource()
.
To ensure that the entire list is loaded, call waitForComplete()
.
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()
and setSelectionValue()
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();
RIFSFile
,
Serialized FormModifier 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 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.
|
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.
|
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
public static final java.lang.String FILTER
IFSFileFilter
selection,
which represents the filter used to select which files are included in the
list.public static final java.lang.String PATTERN
public RIFSFileList()
public RIFSFileList(AS400 system, java.lang.String path)
system
- The system.path
- The directory path.public RIFSFileList(RIFSFile file)
file
- The directory.protected void establishConnection() throws ResourceException
The method is called by the resource framework automatically when the connection needs to be established.
establishConnection
in class ResourceList
ResourceException
- If an error occurs.protected void freezeProperties() throws ResourceException
The method is called by the resource framework automatically when the properties need to be frozen.
freezeProperties
in class ResourceList
ResourceException
- If an error occurs.public java.lang.String getPath()
public void open() throws ResourceException
open
in class ResourceList
ResourceException
- If an error occurs.public void refreshContents() throws ResourceException
This will implicitly open the list if needed.
refreshContents
in class ResourceList
ResourceException
- If an error occurs.public Resource resourceAt(long index) throws ResourceException
This will implicitly open the list if needed.
resourceAt
in class ResourceList
index
- The index.ResourceException
- If an error occurs.public void setPath(java.lang.String path)
path
- The directory path.public void waitForComplete() throws ResourceException
This will implicitly open the list if needed.
waitForComplete
in class ResourceList
ResourceException
- If an error occurs.public void waitForResource(long index) throws ResourceException
This will implicitly open the list if needed.
waitForResource
in class ResourceList
index
- The index.ResourceException
- If an error occurs.