public class FileCache extends AbstractMapBackedCache<Md5,File,SimpleMetaData>
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
MD5_PATTERN |
UNLIMITED_IDLE_TIME| Constructor and Description |
|---|
FileCache(String name,
long defaultTimeToLive,
long defaultMaxIdleTime,
ExpungeStrategy expungeStrategy,
File baseDir,
int directoryDepth) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
createDirStructure(File dir,
int directoryDepth)
Recursively creates directories 0x0 - 0xF until the desired depth is reached.
|
protected void |
doDelete(Md5 key,
SimpleMetaData metaData)
Performs deletion of the data belonging to the metadata.
|
protected File |
doGet(Md5 key,
SimpleMetaData metaData)
Performs retrieval of the data belonging to the metadata.
|
protected File |
doPut(Md5 md5,
File data)
Performs storage of the given data and adds new metadata to the map.
|
File |
getBaseDir() |
protected String |
getFileName(Md5 md5) |
protected Map<Md5,SimpleMetaData> |
readInitialMap() |
cleanUp, delete, delete, expunge, get, getEntriesMetaData, getEntriesMetaDataMap, getExpungeStrategy, getMetaData, getStatistics, getWithErrors, put, putWithErrors, setEntriesMetaDataMap, setExpungeStrategygetCleanUpLogger, getDefaultMaxIdleTime, getDefaultTtl, getLogger, getName, setDefaultMaxIdleTime, setDefaultTtlclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDefaultMaxIdleTime, getDefaultTtl, getName, setDefaultTtlpublic static Pattern MD5_PATTERN
public FileCache(String name, long defaultTimeToLive, long defaultMaxIdleTime, ExpungeStrategy expungeStrategy, File baseDir, int directoryDepth) throws IOException, CacheException
IOExceptionCacheExceptionprotected void doDelete(Md5 key, SimpleMetaData metaData) throws CacheException
AbstractMapBackedCachedoDelete in class AbstractMapBackedCache<Md5,File,SimpleMetaData>CacheExceptionprotected File doGet(Md5 key, SimpleMetaData metaData) throws CacheException
AbstractMapBackedCachedoGet in class AbstractMapBackedCache<Md5,File,SimpleMetaData>CacheExceptionprotected File doPut(Md5 md5, File data) throws CacheException
AbstractMapBackedCachedoPut in class AbstractMapBackedCache<Md5,File,SimpleMetaData>CacheExceptionpublic final File getBaseDir()
protected void createDirStructure(File dir, int directoryDepth) throws IOException
dir - The base directory.directoryDepth - The level of nesting [0,...].IOExceptionprotected Map<Md5,SimpleMetaData> readInitialMap() throws CacheException
CacheExceptionCopyright © 2013 dontdrinkandroot. All Rights Reserved.