public class DiskLruCacheWrapper extends Object implements DiskCache
get(java.io.File, int)
DiskCache.Factory, DiskCache.Writer
Modifier | Constructor and Description |
---|---|
protected |
DiskLruCacheWrapper(File directory,
int maxSize) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the cache.
|
void |
delete(Key key)
Remove the key and value from the cache.
|
static DiskCache |
get(File directory,
int maxSize)
Get a DiskCache in the given directory and size.
|
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.
|
protected DiskLruCacheWrapper(File directory, int maxSize)
public static DiskCache get(File directory, int maxSize)
directory
- The directory for the disk cachemaxSize
- The max size for the disk cachepublic File get(Key key)
DiskCache
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.
public void put(Key key, DiskCache.Writer writer)
DiskCache
DiskCache.Writer
is used so that the cache implementation can perform actions after
the write finishes, like commit (via atomic file rename).public void delete(Key key)
DiskCache