org.apache.commons.io

Class FileCleaningTracker.Tracker

Enclosing Class:
FileCleaningTracker

private static final class FileCleaningTracker.Tracker
extends PhantomReference

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

Field Summary

private FileDeleteStrategy
deleteStrategy
The strategy for deleting files.
private String
path
The full path to the file being tracked.

Constructor Summary

Tracker(String path, FileDeleteStrategy deleteStrategy, Object marker, ReferenceQueue queue)
Constructs an instance of this class from the supplied parameters.

Method Summary

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

Field Details

deleteStrategy

private final FileDeleteStrategy deleteStrategy
The strategy for deleting files.

path

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

Constructor Details

Tracker

(package private)  Tracker(String path,
                           FileDeleteStrategy deleteStrategy,
                           Object marker,
                           ReferenceQueue 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.

Copyright (c) 2002-2009 Apache Software Foundation