org.icepdf.core.util
Class CacheManager

java.lang.Object
  extended by org.icepdf.core.util.CacheManager

public class CacheManager
extends java.lang.Object

The CacheManager class has one very simple task which is to ensure that when a document is closed there are no temporary ByteCache or ImageCache objects left in the user's temporary folder.

Whenever a new ByteCache or ImageCache object is created, the corresponding cached file name is registered with the CacheManger. When the document is closed and the CacheManager despose() method is called, all of the registered files are deleted from the file system.

Since:
1.1

Constructor Summary
CacheManager()
          Create a new instance of a CacheManager.
 
Method Summary
 void addCachedFile(java.lang.String filePath)
          Add the file name of either a ByteCache or ImageCache object cached file.
 void dispose()
          Remove all files specified by the addCachedFile method along with the temporary file created by this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheManager

public CacheManager()
Create a new instance of a CacheManager.

Method Detail

addCachedFile

public void addCachedFile(java.lang.String filePath)
Add the file name of either a ByteCache or ImageCache object cached file.

Parameters:
filePath - the absolulte path to a temporary file.

dispose

public void dispose()
Remove all files specified by the addCachedFile method along with the temporary file created by this class.