public class FileCache
extends com.google.common.cache.AbstractCache<java.lang.String,java.io.File>
implements java.io.Closeable
| Modifier and Type | Method and Description |
|---|---|
static FileCache |
build(long maxSize,
java.io.File root,
com.google.common.cache.CacheLoader<java.lang.String,java.io.InputStream> loader,
@Nullable java.util.concurrent.ExecutorService executor) |
void |
close() |
boolean |
containsKey(java.lang.String key) |
java.io.File |
get(java.lang.String key) |
@Nullable java.io.File |
getIfPresent(java.lang.Object key) |
@Nullable java.io.File |
getIfPresent(java.lang.String key)
Retrieves the file handle from the cache if present and null otherwise.
|
DataStoreCacheStatsMBean |
getStats() |
void |
invalidate(java.lang.Object key) |
void |
put(java.lang.String key,
java.io.File file)
Puts the given key and file into the cache.
|
public static FileCache build(long maxSize, java.io.File root, com.google.common.cache.CacheLoader<java.lang.String,java.io.InputStream> loader, @Nullable @Nullable java.util.concurrent.ExecutorService executor)
public void put(java.lang.String key,
java.io.File file)
getIfPresent(String).put in interface com.google.common.cache.Cache<java.lang.String,java.io.File>put in class com.google.common.cache.AbstractCache<java.lang.String,java.io.File>key - of the filefile - to put into cachepublic boolean containsKey(java.lang.String key)
@Nullable public @Nullable java.io.File getIfPresent(java.lang.String key)
key - of the file to retrieve@Nullable public @Nullable java.io.File getIfPresent(java.lang.Object key)
getIfPresent in interface com.google.common.cache.Cache<java.lang.String,java.io.File>public java.io.File get(java.lang.String key)
throws java.io.IOException
java.io.IOExceptionpublic void invalidate(java.lang.Object key)
invalidate in interface com.google.common.cache.Cache<java.lang.String,java.io.File>invalidate in class com.google.common.cache.AbstractCache<java.lang.String,java.io.File>public DataStoreCacheStatsMBean getStats()
public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableCopyright © 2010 - 2023 Adobe. All Rights Reserved