Class FileCleaningTracker.Tracker

java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.PhantomReference<Object>
org.apache.commons.io.FileCleaningTracker.Tracker
Enclosing class:
FileCleaningTracker

private static final class FileCleaningTracker.Tracker extends PhantomReference<Object>
Inner class which acts as the reference for a file pending deletion.
  • Field Details

    • path

      private final String path
      The full path to the file being tracked.
    • deleteStrategy

      private final FileDeleteStrategy 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 null
      deleteStrategy - the strategy to delete the file, null means normal
      marker - the marker object used to track the file, not null
      queue - the queue on to which the tracker will be pushed, not null
  • Method Details

    • delete

      public boolean delete()
      Deletes the file associated with this tracker instance.
      Returns:
      true if the file was deleted successfully; false otherwise.
    • getPath

      public String getPath()
      Return the path.
      Returns:
      the path