Package org.cip4.jdflib.util.file
Class FileJanitor
- java.lang.Object
-
- org.cip4.jdflib.util.file.FileJanitor
-
public class FileJanitor extends java.lang.Objectclass to clean up files and directories the directories are retained longer since java knows only last modified. This is actually a good thing
-
-
Constructor Summary
Constructors Constructor Description FileJanitor(java.io.File baseDir, long age)FileJanitor(java.io.File baseDir, java.io.FileFilter filter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Vector<java.io.File>cleanup()process all accepted files and empty directories that have been accepted
note that the filter may actually do somethingbooleanisRecurseDirs()voidsetDeleteEmptyDir(boolean delEmpty)if true, we delete empty directoriesvoidsetLogSingle(boolean logSingle)if true, we log each deletionvoidsetMinKeep(int minKeep)voidsetRecurseDirs(boolean recurseDirs)java.lang.StringtoString()
-
-
-
Method Detail
-
setMinKeep
public void setMinKeep(int minKeep)
-
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-
-
isRecurseDirs
public boolean isRecurseDirs()
-
setRecurseDirs
public void setRecurseDirs(boolean recurseDirs)
-
cleanup
public java.util.Vector<java.io.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 java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-