Class FileCache
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
DOWNLOAD_DIR
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FileCache
build(long maxSize, File root, org.apache.jackrabbit.guava.common.cache.CacheLoader<String,InputStream> loader, @Nullable ExecutorService executor)
void
close()
boolean
containsKey(String key)
File
get(String key)
@Nullable File
getIfPresent(Object key)
@Nullable 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.
-
-
-
Field Detail
-
DOWNLOAD_DIR
protected static final String DOWNLOAD_DIR
- See Also:
- Constant Field Values
-
-
Method Detail
-
build
public static FileCache build(long maxSize, File root, org.apache.jackrabbit.guava.common.cache.CacheLoader<String,InputStream> loader, @Nullable @Nullable ExecutorService executor)
-
put
public void put(String key, File file)
Puts the given key and file into the cache. The file is moved to the cache. So, the original file won't be available after this operation. It can be retrieved usinggetIfPresent(String)
.
-
containsKey
public boolean containsKey(String key)
-
getIfPresent
@Nullable public @Nullable File getIfPresent(String key)
Retrieves the file handle from the cache if present and null otherwise.- Parameters:
key
- of the file to retrieve- Returns:
- File handle if available
-
get
public File get(String key) throws IOException
- Throws:
IOException
-
invalidate
public void invalidate(Object key)
-
getStats
public DataStoreCacheStatsMBean getStats()
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-