com.faunos.util.io.file
Class DirectoryRemover

java.lang.Object
  extended by com.faunos.util.io.file.DirectoryRemover

public class DirectoryRemover
extends Object

Recursively removes the contents of a directory tree. Similar to rm myDir -rf.

Warning!

This class performs an inherently dangerous operation: it removes any directory tree. Be very careful how you call this code. As a small security measure, this class provides a global (i.e. static) minimum depth from root parameter that is initialized to 3.

Author:
Babak Farhang

Nested Class Summary
protected static class DirectoryRemover.Deleter
           
 
Constructor Summary
DirectoryRemover()
           
 
Method Summary
static int getMinDepthFromRoot()
           
static boolean removeTree(File root)
           
static void setMinDepthFromRoot(int minDepth)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryRemover

public DirectoryRemover()
Method Detail

getMinDepthFromRoot

public static int getMinDepthFromRoot()

setMinDepthFromRoot

public static void setMinDepthFromRoot(int minDepth)

removeTree

public static boolean removeTree(File root)


SourceForge.net Logo