Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.utils.io
Class DirectoryTree

    java.lang.Object
      oracle.ifs.utils.io.DirectoryTree

    public class DirectoryTree

extends java.lang.Object

The class `DirectoryTree` traverses a directory tree in the local filesystem. It calls the `handleItem` method on the given `DirectoryItemHandler` for every file in the directory tree.

Modified:
  dlong 01/25/2005 change handleItem to return boolean, lsaenz 08/02/2001 Use exception nesting., lsaenz 12/07/1999 Added depth-first traversal., lsaenz 12/04/1999 Updated comments., lsaenz 11/22/1999 Created.

Constructor Summary
`DirectoryTree()`

Method Summary
`static void` | `traverse(java.io.File dir, boolean recurse, DirectoryItemHandler strategy)` Traverses a directory tree in the local filesystem.
`static void` | `traverseDepthFirst(java.io.File dir, DirectoryItemHandler strategy)` Traverses a directory tree in the local filesystem.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DirectoryTree

    public DirectoryTree()

Method Detail

### traverse

    public static void traverse(java.io.File dir,
                                boolean recurse,
                                DirectoryItemHandler strategy)
                         throws DirectoryItemHandlerException

  Description copied from class: `DirectoryTree`
  Traverses a directory tree in the local filesystem.

  Parameters:
    `dir` - the root directory at which to begin the traversal.
    `recurse` - whether or not to recurse through every subdirectory within the root directory.
    `strategy` - the `DirectoryItemHandler` to use for handling each item in the tree.
  Throws:
    `DirectoryItemHandlerException` - if an error occurs while handling the items in the directory.

### traverseDepthFirst

    public static void traverseDepthFirst(java.io.File dir,
                                          DirectoryItemHandler strategy)
                                   throws DirectoryItemHandlerException

  Description copied from class: `DirectoryTree`
  Traverses a directory tree in the local filesystem. This traversal is "depth-first" -- i.e., the items in the directories are handled after the recursive call. This method is good for deleting an entire directory tree, since all of the subdirectory's files must be deleted before the top level directory can be deleted.

  Parameters:
    `dir` - the root directory at which to begin the traversal.
    `strategy` - the `DirectoryItemHandler` to use for handling each item in the tree.
  Throws:
    `DirectoryItemHandlerException` - if an error occurs while handling the items in the directory.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD