Class DiskLruCacheWrapper
java.lang.Object
com.bumptech.glide.load.engine.cache.DiskLruCacheWrapper
- All Implemented Interfaces:
DiskCache
The default DiskCache implementation. There must be no more than one active instance for a given
directory at a time.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.bumptech.glide.load.engine.cache.DiskCache
DiskCache.Factory, DiskCache.Writer -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDiskLruCacheWrapper(File directory, long maxSize) Deprecated.Do not extend this class. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the cache.static DiskCacheCreate a new DiskCache in the given directory with a specified max size.voidRemove the key and value from the cache.Get the cache for the value at the given key.static DiskCacheDeprecated.Usecreate(File, long)to create a new cache with the specified arguments.voidput(Key key, DiskCache.Writer writer) Write to a key in the cache.
-
Constructor Details
-
DiskLruCacheWrapper
Deprecated.Do not extend this class.
-
-
Method Details
-
get
Deprecated.Usecreate(File, long)to create a new cache with the specified arguments.Get a DiskCache in the given directory and size. If a disk cache has already been created with a different directory and/or size, it will be returned instead and the new arguments will be ignored.- Parameters:
directory- The directory for the disk cachemaxSize- The max size for the disk cache- Returns:
- The new disk cache with the given arguments, or the current cache if one already exists
-
create
Create a new DiskCache in the given directory with a specified max size.- Parameters:
directory- The directory for the disk cachemaxSize- The max size for the disk cache- Returns:
- The new disk cache with the given arguments
-
get
Description copied from interface:DiskCacheGet 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 time and we won't know about it.
-
put
Description copied from interface:DiskCacheWrite to a key in the cache.DiskCache.Writeris used so that the cache implementation can perform actions after the write finishes, like commit (via atomic file rename). -
delete
Description copied from interface:DiskCacheRemove the key and value from the cache. -
clear
public void clear()Description copied from interface:DiskCacheClear the cache.
-