Class ListDirectory


  • public class ListDirectory
    extends java.lang.Object
    This sample demonstrates how to list the contents of a directory in two different ways. One approach lists all of the objects in the directory and the other approach lists only the sub-directories. The directory name is given as an argument to main, and it may be either a HFS directory or a PDS directory.
    Since:
    2.4.0
    See Also:
    PdsDirectory
    • Constructor Summary

      Constructors 
      Constructor Description
      ListDirectory()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void listSubdirectories​(java.lang.String dirName)
      Lists only the sub-directories.
      static void main​(java.lang.String[] args)
      The main method accepts a directory name as the only argument and calls both listAll(String) and listSubdirectories(String) to list the directory contents.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ListDirectory

        public ListDirectory()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
        The main method accepts a directory name as the only argument and calls both listAll(String) and listSubdirectories(String) to list the directory contents.
        Parameters:
        args - The name of the directory to list
      • listSubdirectories

        public static void listSubdirectories​(java.lang.String dirName)
        Lists only the sub-directories.
        Parameters:
        dirName - The name of the directory to list