public abstract class BinaryFileCache extends LRUFileCache
FileCache
based on
fetchFile(java.lang.String, java.io.File)
and fetchLength(java.lang.String)
methods.SIMPLE_ASCII
Constructor and Description |
---|
BinaryFileCache(File dir,
long maxSize) |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
fetchFile(String key,
File tmp)
Fetches the file from the cache or the remote database.
|
abstract Long |
fetchLength(String key)
Fetches the length from the remote database.
|
File |
getFile(String key)
Gets a file from the cache.
|
Long |
getLength(String key) |
clear, getNumberOfItems, getSize, getTempFile, putFile, putFile
public BinaryFileCache(File dir, long maxSize)
public abstract boolean fetchFile(String key, File tmp)
If something is retrieved from the database, it is put in cache.
key
- identify the file in cachetmp
- the temporary file to use to store the filetrue
if a file was fetched, false
if the expected
blob is missing from the database.public abstract Long fetchLength(String key)
key
- identify the file in cachenull
if the expected blob is missing from
the database.public File getFile(String key)
FileCache
A returned file will never be deleted from the filesystem while the returned file object is still referenced, although it may be purged from the cache.
getFile
in interface FileCache
getFile
in class LRUFileCache
key
- the cache keynull
if absentCopyright © 2013 Nuxeo SA. All Rights Reserved.