TempFileDeleter

This class deletes temporary files when they are not used any longer.

Methods
static TempFileDeleter getInstance()
static TempFileDeleter getInstance()
Reference addFile(String fileName, Object file)
Add a file to the list of temp files to delete.
Reference addFile(String fileName, Object file)
Add a file to the list of temp files to delete. The file is deleted once the file object is garbage collected.
Parameters:
fileName - the file name
file - the object to monitor
Returns:
the reference that can be used to stop deleting the file
void deleteAll()
Delete all registered temp files.
void deleteAll()
Delete all registered temp files.
void deleteFile(Reference ref, String fileName)
Delete the given file now.
void deleteFile(Reference ref, String fileName)
Delete the given file now. This will remove the reference from the list.
Parameters:
ref - the reference as returned by addFile
fileName - the file name
void deleteUnused()
Delete all unused files now.
void deleteUnused()
Delete all unused files now.
void stopAutoDelete(Reference ref, String fileName)
This method is called if a file should no longer be deleted if the object is garbage collected.
void stopAutoDelete(Reference ref, String fileName)
This method is called if a file should no longer be deleted if the object is garbage collected.
Parameters:
ref - the reference as returned by addFile
fileName - the file name