Package org.frankframework.util
Class DirectoryCleaner
java.lang.Object
org.frankframework.util.DirectoryCleaner
Cleans up a directory.
- Author:
- Peter Leeuwenburgh
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanup()
boolean
boolean
boolean
void
setDeleteEmptySubdirectories
(boolean b) whentrue
, empty subdirectories will be deleted, toovoid
setDirectory
(String directory) directory to be cleaned upvoid
setNotExistWarn
(boolean b) when settrue
, send warnings to logging and console about not existing directoriesvoid
setRetention
(String retention) Minimum amount of time (with suffix 'd', 'h', 'm' or 's') that must have passed before a file will be deleted.void
setSubdirectories
(boolean b) whentrue
, files in subdirectories will be deleted, too
-
Field Details
-
log
protected org.apache.logging.log4j.Logger log
-
-
Constructor Details
-
DirectoryCleaner
public DirectoryCleaner()
-
-
Method Details
-
cleanup
public void cleanup() -
setDirectory
directory to be cleaned up -
getDirectory
-
setRetention
Minimum amount of time (with suffix 'd', 'h', 'm' or 's') that must have passed before a file will be deleted. You may only use one suffix!- Default value
- 30d
-
getRetention
-
setSubdirectories
public void setSubdirectories(boolean b) whentrue
, files in subdirectories will be deleted, too- Default value
- false
-
isSubdirectories
public boolean isSubdirectories() -
setDeleteEmptySubdirectories
public void setDeleteEmptySubdirectories(boolean b) whentrue
, empty subdirectories will be deleted, too- Default value
- false
-
isDeleteEmptySubdirectories
public boolean isDeleteEmptySubdirectories() -
setNotExistWarn
public void setNotExistWarn(boolean b) when settrue
, send warnings to logging and console about not existing directories- Default value
- true
-
isNotExistWarn
public boolean isNotExistWarn()
-