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 somethingvoidsetDeleteEmptyDir(boolean delEmpty)if true, we delete empty directoriesvoidsetLogSingle(boolean logSingle)if true, we log each deletionjava.lang.StringtoString()
-
-
-
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 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- See Also:
Object.toString()
-
-