| Modifier and Type | Field and Description |
|---|---|
| private final ReferenceQueue | |
| private final HashMap |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized Reference | |
| public void | |
| public synchronized void | deleteFile(Reference<?>
the reference as returned by addFile ref, Object the file name or closeable resource)Delete the given file or close the closeable now. |
| public void | |
| public static TempFileDeleter | |
| public void | stopAutoDelete(Reference<?>
the reference as returned by addFile ref, Object file name or closeable resource)This method is called if a file should no longer be deleted or a resource should no longer be closed if the object is garbage collected. |
| queue | back to summary |
|---|---|
| private final ReferenceQueue<Object> queue | |
| refMap | back to summary |
|---|---|
| private final HashMap<PhantomReference<?>, Object> refMap | |
| TempFileDeleter | back to summary |
|---|---|
| private TempFileDeleter() | |
| addFile | back to summary |
|---|---|
| public synchronized Reference Add a file or a closeable to the list of temporary objects to delete. The file is deleted once the file object is garbage collected. | |
| deleteAll | back to summary |
|---|---|
| public void deleteAll() Delete all registered temp resources. | |
| deleteFile | back to summary |
|---|---|
| public synchronized void deleteFile(Reference<?> ref, Object resource) Delete the given file or close the closeable now. This will remove the reference from the list. | |
| deleteUnused | back to summary |
|---|---|
| public void deleteUnused() Delete all unused resources now. | |
| getInstance | back to summary |
|---|---|
| public static TempFileDeleter getInstance() | |
| stopAutoDelete | back to summary |
|---|---|
| public void stopAutoDelete(Reference<?> ref, Object resource) This method is called if a file should no longer be deleted or a resource should no longer be closed if the object is garbage collected. | |