org.apache.commons.io
Class FileCleaningTracker.Tracker
java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.PhantomReference
org.apache.commons.io.FileCleaningTracker.Tracker
- Enclosing class:
- FileCleaningTracker
private static final class FileCleaningTracker.Tracker
- extends java.lang.ref.PhantomReference
Inner class which acts as the reference for a file pending deletion.
|
Constructor Summary |
FileCleaningTracker.Tracker(java.lang.String path,
FileDeleteStrategy deleteStrategy,
java.lang.Object marker,
java.lang.ref.ReferenceQueue queue)
Constructs an instance of this class from the supplied parameters. |
|
Method Summary |
boolean |
delete()
Deletes the file associated with this tracker instance. |
| Methods inherited from class java.lang.ref.PhantomReference |
get |
| Methods inherited from class java.lang.ref.Reference |
clear, enqueue, isEnqueued |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
path
private final java.lang.String path
- The full path to the file being tracked.
deleteStrategy
private final FileDeleteStrategy deleteStrategy
- The strategy for deleting files.
FileCleaningTracker.Tracker
FileCleaningTracker.Tracker(java.lang.String path,
FileDeleteStrategy deleteStrategy,
java.lang.Object marker,
java.lang.ref.ReferenceQueue queue)
- Constructs an instance of this class from the supplied parameters.
- Parameters:
path - the full path to the file to be tracked, not nulldeleteStrategy - the strategy to delete the file, null means normalmarker - the marker object used to track the file, not nullqueue - the queue on to which the tracker will be pushed, not null
delete
public boolean delete()
- Deletes the file associated with this tracker instance.
- Returns:
true if the file was deleted successfully;
false otherwise.
Copyright (c) 2002-2011 Apache Software Foundation