Package org.apache.commons.io
Class FileCleaningTracker.Tracker
- Enclosing class:
- FileCleaningTracker
Inner class which acts as the reference for a file pending deletion.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FileDeleteStrategy
The strategy for deleting files.private final String
The full path to the file being tracked. -
Constructor Summary
ConstructorsConstructorDescriptionTracker
(String path, FileDeleteStrategy deleteStrategy, Object marker, ReferenceQueue<? super Object> queue) Constructs an instance of this class from the supplied parameters. -
Method Summary
Methods inherited from class java.lang.ref.PhantomReference
get
Methods inherited from class java.lang.ref.Reference
clear, clone, enqueue, isEnqueued, reachabilityFence, refersTo
-
Field Details
-
path
The full path to the file being tracked. -
deleteStrategy
The strategy for deleting files.
-
-
Constructor Details
-
Tracker
Tracker(String path, FileDeleteStrategy deleteStrategy, Object marker, ReferenceQueue<? super Object> 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
-
-
Method Details
-
getPath
Return the path.- Returns:
- the path
-
delete
public boolean delete()Deletes the file associated with this tracker instance.- Returns:
true
if the file was deleted successfully;false
otherwise.
-