org.cip4.jdflib.util.file
Class FileJanitor

java.lang.Object
  extended by org.cip4.jdflib.util.file.FileJanitor

public class FileJanitor
extends Object

class to clean up files and directories the directories are retained longer since java knows only last modified. This is actually a good thing

Author:
rainer prosi

Constructor Summary
FileJanitor(File baseDir, FileFilter filter)
           
FileJanitor(File baseDir, long age)
           
 
Method Summary
 Vector<File> cleanup()
          process all accepted files and empty directories that have been accepted
note that the filter may actually do something
 void setDeleteEmptyDir(boolean delEmpty)
          if true, we delete empty directories
 void setLogSingle(boolean logSingle)
          if true, we log each deletion
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileJanitor

public FileJanitor(File baseDir,
                   FileFilter filter)
Parameters:
baseDir -
filter - the file filter that

FileJanitor

public FileJanitor(File baseDir,
                   long age)
Parameters:
baseDir -
age - the minimum zapp file age in seconds
Method Detail

setLogSingle

public void setLogSingle(boolean logSingle)
if true, we log each deletion

Parameters:
logSingle -

setDeleteEmptyDir

public void setDeleteEmptyDir(boolean delEmpty)
if true, we delete empty directories

Parameters:
delEmpty -

cleanup

public Vector<File> cleanup()
process all accepted files and empty directories that have been accepted
note that the filter may actually do something

Returns:
the list of files that have been processed
note these no longer exist in case of a kill filter

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2013. All Rights Reserved.