org.apache.commons.io

Class FileCleaningTracker.Tracker

private static final class FileCleaningTracker.Tracker extends PhantomReference

Inner class which acts as the reference for a file pending deletion.
Field Summary
FileDeleteStrategydeleteStrategy
The strategy for deleting files.
Stringpath
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
booleandelete()
Deletes the file associated with this tracker instance.

Field Detail

deleteStrategy

private final FileDeleteStrategy deleteStrategy
The strategy for deleting files.

path

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

Constructor Detail

Tracker

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 Detail

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