java.lang.Object
org.apache.wicket.util.file.FileCleaner
- All Implemented Interfaces:
IFileCleaner
Default implementation of
IFileCleaner that uses Apache commons-io
FileCleaningTracker to track and clean the temporary created files.
Note: this implementation starts a daemon thread to do the actual work, so it may not be used in some environments like Google AppEngine.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Call this method to stop the cleaner and to free all allocated resources by itvoidTrack the specified file, using the provided marker, deleting the file when the marker instance is garbage collected.voidTrack the specified file, using the provided marker, deleting the file when the marker instance is garbage collected.
-
Constructor Details
-
FileCleaner
public FileCleaner()Construct.
-
-
Method Details
-
track
Description copied from interface:IFileCleanerTrack the specified file, using the provided marker, deleting the file when the marker instance is garbage collected.- Specified by:
trackin interfaceIFileCleaner- Parameters:
file- the file to be tracked, not nullmarker- the marker object used to track the file, not null
-
track
public void track(File file, Object marker, org.apache.commons.io.FileDeleteStrategy deleteStrategy) Description copied from interface:IFileCleanerTrack the specified file, using the provided marker, deleting the file when the marker instance is garbage collected.- Specified by:
trackin interfaceIFileCleaner- Parameters:
file- the file to be tracked, not nullmarker- the marker object used to track the file, not nulldeleteStrategy- the strategy that actually deletes the file. E.g. to delete a non-empty folder the strategy should delete all children first
-
destroy
Description copied from interface:IFileCleanerCall this method to stop the cleaner and to free all allocated resources by it- Specified by:
destroyin interfaceIFileCleaner
-