com.bumptech.glide.load.engine.cache
Class DiskCacheAdapter

java.lang.Object
  extended by com.bumptech.glide.load.engine.cache.DiskCacheAdapter
All Implemented Interfaces:
DiskCache

public class DiskCacheAdapter
extends Object
implements DiskCache

A simple class that returns null for all gets and ignores all writes.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.bumptech.glide.load.engine.cache.DiskCache
DiskCache.Factory, DiskCache.Writer
 
Constructor Summary
DiskCacheAdapter()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiskCacheAdapter

public DiskCacheAdapter()
Method Detail

get

public File get(Key key)
Description copied from interface: DiskCache
Get the cache for the value at the given 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.

Specified by:
get in interface DiskCache
Parameters:
key - The key in the cache.
Returns:
An InputStream representing the data at key at the time get is called.

put

public void put(Key key,
                DiskCache.Writer writer)
Description copied from interface: DiskCache
Write to a key in the cache. DiskCache.Writer is used so that the cache implementation can perform actions after the write finishes, like commit (via atomic file rename).

Specified by:
put in interface DiskCache
Parameters:
key - The key to write to.
writer - An interface that will write data given an OutputStream for the key.

delete

public void delete(Key key)
Description copied from interface: DiskCache
Remove the key and value from the cache.

Specified by:
delete in interface DiskCache
Parameters:
key - The key to remove.

clear

public void clear()
Description copied from interface: DiskCache
Clear the cache.

Specified by:
clear in interface DiskCache