|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.io.FileCleaner
Keeps track of files awaiting deletion, and deletes them when an associated marker object is reclaimed by the garbage collector.
Nested Class Summary | |
private static class |
FileCleaner.Tracker
Inner class which acts as the reference for a file pending deletion. |
Field Summary | |
private static java.lang.ref.ReferenceQueue |
q
Queue of Tracker instances being watched. |
private static java.lang.Thread |
reaper
The thread that will clean up registered files. |
private static java.util.Collection |
trackers
Collection of Tracker instances in existence. |
Constructor Summary | |
FileCleaner()
|
Method Summary | |
static int |
getTrackCount()
Retrieve the number of files currently being tracked, and therefore awaiting deletion. |
static 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. |
static void |
track(java.lang.String path,
java.lang.Object marker)
Track the specified file, using the provided marker, deleting the file when the marker instance is garbage collected. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static java.lang.ref.ReferenceQueue q
Tracker
instances being watched.
private static java.util.Collection trackers
Tracker
instances in existence.
private static java.lang.Thread reaper
Constructor Detail |
public FileCleaner()
Method Detail |
public static void track(java.io.File file, java.lang.Object marker)
file
- The file to be tracked.marker
- The marker object used to track the file.public static void track(java.lang.String path, java.lang.Object marker)
path
- The full path to the file to be tracked.marker
- The marker object used to track the file.public static int getTrackCount()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |