org.apache.commons.io
Class FileCleaner.Tracker

java.lang.Object
  extended byjava.lang.ref.Reference
      extended byjava.lang.ref.PhantomReference
          extended byorg.apache.commons.io.FileCleaner.Tracker
Enclosing class:
FileCleaner

private static class FileCleaner.Tracker
extends java.lang.ref.PhantomReference

Inner class which acts as the reference for a file pending deletion.


Nested Class Summary
 
Nested classes inherited from class java.lang.ref.Reference
 
Field Summary
private  java.lang.String path
          The full path to the file being tracked.
 
Fields inherited from class java.lang.ref.Reference
 
Constructor Summary
FileCleaner.Tracker(java.io.File file, java.lang.Object marker, java.lang.ref.ReferenceQueue queue)
          Constructs an instance of this class from the supplied parameters.
FileCleaner.Tracker(java.lang.String path, 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
 

Field Detail

path

private java.lang.String path
The full path to the file being tracked.

Constructor Detail

FileCleaner.Tracker

public FileCleaner.Tracker(java.io.File file,
                           java.lang.Object marker,
                           java.lang.ref.ReferenceQueue queue)
Constructs an instance of this class from the supplied parameters.

Parameters:
file - The file to be tracked.
marker - The marker object used to track the file.
queue - The queue on to which the tracker will be pushed.

FileCleaner.Tracker

public FileCleaner.Tracker(java.lang.String path,
                           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.
marker - The marker object used to track the file.
queue - The queue on to which the tracker will be pushed.
Method Detail

delete

public boolean delete()
Deletes the file associated with this tracker instance.

Returns:
true if the file was deleted successfully; false otherwise.