- java.lang.Object
-
- com.ibm.jzos.PdsDirectory
-
public class PdsDirectory extends java.lang.Object
A class for opening a PDS directory usingZFile
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PdsDirectory.MemberInfo
A static inner class ofPdsDirectory
which defines/maps a member directory entry.
-
Constructor Summary
Constructors Constructor Description PdsDirectory(java.lang.String pdsName)
Open a ZFile with the given name as a PDS directory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the underlying ZFile on the PDS directoryjava.util.Iterator
iterator()
Answer anIterator
over the PDS directory, which returns aPdsDirectory.MemberInfo
object for each entry in the directory.
-
-
-
Constructor Detail
-
PdsDirectory
public PdsDirectory(java.lang.String pdsName) throws java.io.IOException
Open a ZFile with the given name as a PDS directory.- Parameters:
pdsName
- the name given to open the ZFile- Throws:
java.io.IOException
- if the PDS can't be opened with RECFM=U,BLKSIZE=256, or if its DSORG is not PDS_DIR.- See Also:
ZFile(String,String) for rules on file names
-
-
Method Detail
-
close
public void close() throws java.io.IOException
Close the underlying ZFile on the PDS directory- Throws:
java.io.IOException
- as possibly thrown from ZFile.close()
-
iterator
public java.util.Iterator iterator()
Answer anIterator
over the PDS directory, which returns aPdsDirectory.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.
- Returns:
- java.util.Iterator over PdsDirectory.MemberInfo objects
-
-