| Modifier and Type | Field and Description |
|---|---|
protected static String |
DOWNLOAD_DIR |
| Modifier and Type | Method and Description |
|---|---|
static FileCache |
build(long maxSize,
File root,
com.google.common.cache.CacheLoader<String,InputStream> loader,
ExecutorService executor) |
void |
close() |
boolean |
containsKey(String key) |
File |
get(String key) |
File |
getIfPresent(Object key) |
File |
getIfPresent(String key)
Retrieves the file handle from the cache if present and null otherwise.
|
DataStoreCacheStatsMBean |
getStats() |
void |
invalidate(Object key) |
void |
put(String key,
File file)
Puts the given key and file into the cache.
|
protected static final String DOWNLOAD_DIR
public static FileCache build(long maxSize, File root, com.google.common.cache.CacheLoader<String,InputStream> loader, @Nullable ExecutorService executor)
public void put(String key, File file)
getIfPresent(String).public boolean containsKey(String key)
@Nullable public File getIfPresent(String key)
key - of the file to retrievepublic File get(String key) throws IOException
IOExceptionpublic void invalidate(Object key)
public DataStoreCacheStatsMBean getStats()
public void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2012–2017 The Apache Software Foundation. All rights reserved.