Package org.cip4.jdflib.util.file
Class FileJanitor
java.lang.Object
org.cip4.jdflib.util.file.FileJanitor
class 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
ConstructorsConstructorDescriptionFileJanitor(File baseDir, long age) FileJanitor(File baseDir, FileFilter filter) -
Method Summary
Modifier and TypeMethodDescriptioncleanup()process all accepted files and empty directories that have been accepted
note that the filter may actually do somethingbooleanvoidsetDeleteEmptyDir(boolean delEmpty) if true, we delete empty directoriesvoidsetLogSingle(boolean logSingle) if true, we log each deletionvoidsetMinKeep(int minKeep) voidsetRecurseDirs(boolean recurseDirs) toString()
-
Constructor Details
-
FileJanitor
- Parameters:
baseDir-filter- the file filter that
-
FileJanitor
- Parameters:
baseDir-age- the minimum zapp file age in seconds
-
-
Method Details
-
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
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
-