Class DiskLruCacheFactory
java.lang.Object
com.bumptech.glide.load.engine.cache.DiskLruCacheFactory
- All Implemented Interfaces:
DiskCache.Factory
- Direct Known Subclasses:
ExternalCacheDiskCacheFactory,ExternalPreferredCacheDiskCacheFactory,InternalCacheDiskCacheFactory
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, long) constructor variant.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface called out of UI thread to get the cache folder. -
Field Summary
Fields inherited from interface com.bumptech.glide.load.engine.cache.DiskCache.Factory
DEFAULT_DISK_CACHE_DIR, DEFAULT_DISK_CACHE_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionDiskLruCacheFactory(DiskLruCacheFactory.CacheDirectoryGetter cacheDirectoryGetter, long diskCacheSize) When using this constructorDiskLruCacheFactory.CacheDirectoryGetter.getCacheDirectory()will be called out of UI thread, allowing to do I/O access without performance impacts.DiskLruCacheFactory(String diskCacheFolder, long diskCacheSize) DiskLruCacheFactory(String diskCacheFolder, String diskCacheName, long diskCacheSize) -
Method Summary
-
Constructor Details
-
DiskLruCacheFactory
-
DiskLruCacheFactory
-
DiskLruCacheFactory
public DiskLruCacheFactory(DiskLruCacheFactory.CacheDirectoryGetter cacheDirectoryGetter, long diskCacheSize) When using this constructorDiskLruCacheFactory.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.
-
-
Method Details
-
build
Description copied from interface:DiskCache.FactoryReturns a new disk cache, ornullif no disk cache could be created.- Specified by:
buildin interfaceDiskCache.Factory
-