|
Nuxeo Enterprise Platform 5.4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface FileCache
A cache of Files.
The cache uses application-chosen keys.
To check presence in the cache, use getFile(java.lang.String).
To put a new InputStream in the cache, use
putFile(String, InputStream). Or if you'd like a File object
into which to write some data, get one using getTempFile(), put the
actual binary in it, then pass this file to putFile(String, File).
LRUFileCache| Method Summary | |
|---|---|
void |
clear()
Clears the cache. |
File |
getFile(String key)
Gets a file from the cache. |
int |
getNumberOfItems()
Gets the number of items in the cache. |
long |
getSize()
Gets the size of the cache, in bytes. |
File |
getTempFile()
Creates a temporary file. |
File |
putFile(String key,
File file)
Puts a file in the cache. |
File |
putFile(String key,
InputStream in)
Puts a file in the cache. |
| Method Detail |
|---|
long getSize()
int getNumberOfItems()
File getTempFile()
throws IOException
IOException
File putFile(String key,
InputStream in)
throws IOException
key - the cache keyin - the input stream to cache (closed afterwards)
IllegalArgumentException - if the key is illegal
IOException
File putFile(String key,
File file)
throws IOException
The file must have been created through getTempFile(). The file
is "given" to this method, who will delete it or rename it.
key - the cache keyfile - the file to cache
IllegalArgumentException - if the key is illegal
IOExceptionFile getFile(String key)
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.
key - the cache key
null if absentvoid clear()
Files will not be deleted from the filesystm while the returned file objects are still referenced.
|
Nuxeo Enterprise Platform 5.4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||