|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DiskCache
An interface for writing to and reading from a disk cache.
Nested Class Summary | |
---|---|
static interface |
DiskCache.Factory
An interface for lazily creating a disk cache. |
static interface |
DiskCache.Writer
An interface to actually write data to a key in the disk cache. |
Method Summary | |
---|---|
void |
clear()
Clear the cache. |
void |
delete(Key key)
Remove the key and value from the cache. |
File |
get(Key key)
Get the cache for the value at the given key. |
void |
put(Key key,
DiskCache.Writer writer)
Write to a key in the cache. |
Method Detail |
---|
File get(Key key)
Note - This is potentially dangerous, someone may write a new value to the file at any point in timeand we won't know about it.
key
- The key in the cache.
void put(Key key, DiskCache.Writer writer)
DiskCache.Writer
is used so that the cache implementation can perform actions after
the write finishes, like commit (via atomic file rename).
key
- The key to write to.writer
- An interface that will write data given an OutputStream for the key.void delete(Key key)
key
- The key to remove.void clear()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |