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,
int maxSize,
int recycleSize,
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 void |
initialize() |
cleanUp, delete, delete, expunge, expunge, get, getCleanUpInterval, getComparator, getEntriesMetaData, getEntry, getMaxSize, getMetaData, getRecycleSize, getStatistics, getWithErrors, put, putEntry, putWithErrors, setCleanUpInterval, setMaxSize, setRecycleSize, triggerExpungegetCleanUpLogger, 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, int maxSize, int recycleSize, 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 void initialize()
throws CacheException
CacheExceptionCopyright © 2014 dontdrinkandroot. All rights reserved.