com.bumptech.glide.load.engine.cache
Class DiskLruCacheFactory
java.lang.Object
com.bumptech.glide.load.engine.cache.DiskLruCacheFactory
- All Implemented Interfaces:
- DiskCache.Factory
- Direct Known Subclasses:
- ExternalCacheDiskCacheFactory, InternalCacheDiskCacheFactory
public class DiskLruCacheFactory
- extends Object
- implements DiskCache.Factory
Creates an DiskLruCache
based disk cache in the specified disk cache
directory.
If you need to make I/O access before returning the cache directory use
the DiskLruCacheFactory(CacheDirectoryGetter, int)
constructor variant.
Method Summary |
DiskCache |
build()
Returns a new disk cache, or null if no disk cache could be created. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DiskLruCacheFactory
public DiskLruCacheFactory(String diskCacheFolder,
int diskCacheSize)
DiskLruCacheFactory
public DiskLruCacheFactory(String diskCacheFolder,
String diskCacheName,
int diskCacheSize)
DiskLruCacheFactory
public DiskLruCacheFactory(DiskLruCacheFactory.CacheDirectoryGetter cacheDirectoryGetter,
int diskCacheSize)
- When using this constructor
DiskLruCacheFactory.CacheDirectoryGetter.getCacheDirectory()
will be called out of UI thread,
allowing to do I/O access without performance impacts.
- Parameters:
cacheDirectoryGetter
- Interface called out of UI thread to get the cache folder.diskCacheSize
- Desired max bytes size for the LRU disk cache.
build
public DiskCache build()
- Description copied from interface:
DiskCache.Factory
- Returns a new disk cache, or
null
if no disk cache could be created.
- Specified by:
build
in interface DiskCache.Factory