public class DiskLruCacheWrapper extends Object implements DiskCache
get(java.io.File, long)
DiskCache.Factory, DiskCache.Writer
Modifier | Constructor and Description |
---|---|
protected |
DiskLruCacheWrapper(File directory,
long maxSize)
Deprecated.
Do not extend this class.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the cache.
|
static DiskCache |
create(File directory,
long maxSize)
Create a new DiskCache in the given directory with a specified max size.
|
void |
delete(Key key)
Remove the key and value from the cache.
|
static DiskCache |
get(File directory,
long maxSize)
Deprecated.
Use
create(File, long) to create a new cache with the specified arguments. |
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.
|
@Deprecated protected DiskLruCacheWrapper(File directory, long maxSize)
@Deprecated public static DiskCache get(File directory, long maxSize)
create(File, long)
to create a new cache with the specified arguments.directory
- The directory for the disk cachemaxSize
- The max size for the disk cachepublic static DiskCache create(File directory, long 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 time and 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