public class FileCache extends AbstractCache<String,File> implements Closeable
AbstractCache.SimpleStatsCounter, AbstractCache.StatsCounter| Modifier and Type | Method and Description |
|---|---|
static FileCache |
build(long maxSize,
File root,
CacheLoader<String,InputStream> loader,
@Nullable ExecutorService executor) |
void |
close() |
boolean |
containsKey(String key) |
File |
get(String key) |
@Nullable File |
getIfPresent(Object key)
Returns the value associated with
key in this cache, or null if there is no
cached value for key. |
@Nullable File |
getIfPresent(String key)
Retrieves the file handle from the cache if present and null otherwise.
|
DataStoreCacheStatsMBean |
getStats() |
void |
invalidate(Object key)
Discards any cached value for key
key. |
void |
put(String key,
File file)
Puts the given key and file into the cache.
|
asMap, cleanUp, get, getAllPresent, invalidateAll, invalidateAll, putAll, size, statspublic static FileCache build(long maxSize, File root, CacheLoader<String,InputStream> loader, @Nullable @Nullable ExecutorService executor)
public void put(String key, File file)
getIfPresent(String).public boolean containsKey(String key)
@Nullable public @Nullable File getIfPresent(String key)
key - of the file to retrieve@Nullable public @Nullable File getIfPresent(Object key)
Cachekey in this cache, or null if there is no
cached value for key.getIfPresent in interface Cache<String,File>public File get(String key) throws IOException
IOExceptionpublic void invalidate(Object key)
Cachekey.invalidate in interface Cache<String,File>invalidate in class AbstractCache<String,File>public DataStoreCacheStatsMBean getStats()
public void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2010 - 2020 Adobe. All Rights Reserved