org.apache.wicket.util.file
Interface IFileCleaner

All Known Implementing Classes:
FileCleaner

public interface IFileCleaner

Keeps track of files awaiting deletion, and deletes them when an associated marker object is reclaimed by the garbage collector.

Needed to remove files created temporarily for the needs of FileUpload functionality.


Method Summary
 void destroy()
          Call this method to stop the cleaner and to free all allocated resources by it
 void track(java.io.File file, java.lang.Object marker)
          Track the specified file, using the provided marker, deleting the file when the marker instance is garbage collected.
 void track(java.io.File file, java.lang.Object marker, FileDeleteStrategy deleteStrategy)
          Track the specified file, using the provided marker, deleting the file when the marker instance is garbage collected.
 

Method Detail

track

void track(java.io.File file,
           java.lang.Object marker)
Track the specified file, using the provided marker, deleting the file when the marker instance is garbage collected.

Parameters:
file - the file to be tracked, not null
marker - the marker object used to track the file, not null
Throws:
java.lang.NullPointerException - if the file is null

track

void track(java.io.File file,
           java.lang.Object marker,
           FileDeleteStrategy deleteStrategy)
Track the specified file, using the provided marker, deleting the file when the marker instance is garbage collected.

Parameters:
file - the file to be tracked, not null
marker - the marker object used to track the file, not null
deleteStrategy - the strategy that actually deletes the file. E.g. to delete a non-empty folder the strategy should delete all children first
Throws:
java.lang.NullPointerException - if the file is null

destroy

void destroy()
Call this method to stop the cleaner and to free all allocated resources by it



Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.