com.ibm.jzos

Class PdsDirectory

  • java.lang.Object
    • com.ibm.jzos.PdsDirectory


  • public class PdsDirectory
    extends java.lang.Object
    A class for opening a PDS directory using 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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  PdsDirectory.MemberInfo
      A static inner class of PdsDirectory which defines/maps a member directory entry.
    • Constructor Summary

      Constructors 
      Constructor and 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 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.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 an 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.

        Returns:
        java.util.Iterator over PdsDirectory.MemberInfo objects
� Copyright IBM Corporation 2005, 2022.