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 DeleteDirectory

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

All Implemented Interfaces:
  DirectoryItemHandler

    public class DeleteDirectory

extends java.lang.Object
implements DirectoryItemHandler

The class `DeleteDirectory` deletes directories from the local filesystem. It can optionally recurse through an entire directory tree and delete everything under a specified root directory.

Modified:
  dlong 01/25/2005 change handleItem to return boolean, lsaenz 12/07/1999 Created.

Constructor Summary
`protected` | `DeleteDirectory(boolean verbose)` Creates a new `DeleteDirectory`.

Method Summary
`static void` | `delete(java.lang.String dir, boolean recurse, boolean delete, boolean verbose)` Deletes the contents of a directory, optionally deleting the contents of every subdirectory recursivley.
`boolean` | `handleItem(java.io.File f, int howDeep)` Defines `DirectoryItemHandler`.

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

Constructor Detail

### DeleteDirectory

    protected DeleteDirectory(boolean verbose)

  Creates a new `DeleteDirectory`.

  Parameters:
    `verbose` - if true, prints messages to System.out during the directory traversal ("deleting file: ")

Method Detail

### delete

    public static void delete(java.lang.String dir,
                              boolean recurse,
                              boolean delete,
                              boolean verbose)

  Description copied from class: `DeleteDirectory`
  Deletes the contents of a directory, optionally deleting the contents of every subdirectory recursivley. Optionally deletes the directory specified to delete the contents of.

  Parameters:
    `dir` - the directory to delete
    `recurse` - whether or not to delete the contents of every subdirectory recursively.
    `delete` - whether or not to delete the root directory (`dir`) after deleting all of its contents.
    `verbose` - if true, prints messages to System.out during the directory traversal ("deleting file: ")

### handleItem

    public boolean handleItem(java.io.File f,
                              int howDeep)

  Description copied from class: `DeleteDirectory`
  Defines `DirectoryItemHandler`.
  Deletes the current File in a directory tree traversal. Uses indenting to show the level of the traversal.

  Specified by:
    `handleItem` in interface `DirectoryItemHandler`
  Parameters:
    `f` - the current File being handled by `DirectoryTree.traverse`.
    `howDeep` - how "deep" the traversal is in the tree, with respect to the root folder in the local filesystem. (i.e., if the current file is: `/foo/bar/a/b/x.txt` and the root of the traversal was specified as `/foo/bar`, then `howDeep == 2`.)
  Returns:
    true if the traversal is free to continue; false if it shoul dbe short-circuited

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