org.meshcms.util
Class DirectoryRemover

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.meshcms.util.DirectoryParser
          extended byorg.meshcms.util.DirectoryRemover
All Implemented Interfaces:
java.lang.Runnable

public class DirectoryRemover
extends DirectoryParser

Deletes a directory even if not empty.


Field Summary
 
Fields inherited from class org.meshcms.util.DirectoryParser
initialDir, processStartDir, recursive
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
DirectoryRemover(java.io.File dir)
           
 
Method Summary
 boolean getResult()
          This method can be called after processing to know whether the directory has been fully deleted or not.
protected  void postProcessDirectory(java.io.File file, Path path)
           
protected  void processFile(java.io.File file, Path path)
          This method will be called for any file found while parsing the base directory.
 
Methods inherited from class org.meshcms.util.DirectoryParser
getInitialDir, isProcessStartDir, isRecursive, isSorted, postProcess, preProcess, preProcessDirectory, process, run, setInitialDir, setInitialDir, setProcessStartDir, setRecursive, setSorted
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DirectoryRemover

public DirectoryRemover(java.io.File dir)
Method Detail

postProcessDirectory

protected void postProcessDirectory(java.io.File file,
                                    Path path)
Overrides:
postProcessDirectory in class DirectoryParser

processFile

protected void processFile(java.io.File file,
                           Path path)
Description copied from class: DirectoryParser
This method will be called for any file found while parsing the base directory.

Overrides:
processFile in class DirectoryParser
Parameters:
file - the file to be processed
path - the path of the file (relative to the base directory)

getResult

public boolean getResult()
This method can be called after processing to know whether the directory has been fully deleted or not.

Returns:
true if the directory has been fully deleted, false otherwise.