public class PdsDirectory
extends java.lang.Object
ZFile
and iterating over its members.
This class also supports PDSE directories processed in compatibility mode.
Note: this class does not support reading concatenated partitioned dataset directories, since the C I/O library seems to return "EOF" after the first directory is read.
Note: this class is not thread-safe; access from multiple threads must be serialized.
Modifier and Type | Class and Description |
---|---|
static class |
PdsDirectory.MemberInfo
A static inner class of
PdsDirectory which defines/maps a
member directory entry. |
Constructor and Description |
---|
PdsDirectory(java.lang.String pdsName)
Open a ZFile with the given name as a PDS directory.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the underlying ZFile on the PDS directory
|
java.util.Iterator |
iterator()
Answer an
Iterator over the PDS directory, which returns
a PdsDirectory.MemberInfo object for each entry in the directory. |
public PdsDirectory(java.lang.String pdsName) throws java.io.IOException
pdsName
- the name given to open the ZFilejava.io.IOException
- if the PDS can't be opened with RECFM=U,BLKSIZE=256, or if its
DSORG is not PDS_DIR.ZFile(String,String) for rules on file names
public void close() throws java.io.IOException
java.io.IOException
- as possibly thrown from ZFile.close()public java.util.Iterator iterator()
Iterator
over the PDS directory, which returns
a PdsDirectory.MemberInfo
object for each entry in the directory.
The returned Iterator does not support the optional remove() method specified by java.util.Iterator. It cannot be used to delete members from the PDS directory.