Class ListDirectory

java.lang.Object
com.ibm.jzos.sample.nonvsam.directory.ListDirectory

public class ListDirectory extends 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:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Lists only the sub-directories.
    static void
    main(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 Details

    • ListDirectory

      public ListDirectory()
  • Method Details

    • main

      public static void main(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(String dirName)
      Lists only the sub-directories.
      Parameters:
      dirName - The name of the directory to list