Class DiskLruCacheFactory
- java.lang.Object
-
- com.bumptech.glide.load.engine.cache.DiskLruCacheFactory
-
- All Implemented Interfaces:
DiskCache.Factory
- Direct Known Subclasses:
ExternalCacheDiskCacheFactory,ExternalPreferredCacheDiskCacheFactory,InternalCacheDiskCacheFactory
public class DiskLruCacheFactory extends java.lang.Object implements DiskCache.Factory
Creates anDiskLruCachebased 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 Classes Modifier and Type Class Description static interfaceDiskLruCacheFactory.CacheDirectoryGetterInterface 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
Constructors Constructor Description 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.DiskLruCacheFactory(java.lang.String diskCacheFolder, long diskCacheSize)DiskLruCacheFactory(java.lang.String diskCacheFolder, java.lang.String diskCacheName, long diskCacheSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DiskCachebuild()Returns a new disk cache, ornullif no disk cache could be created.
-
-
-
Constructor Detail
-
DiskLruCacheFactory
public DiskLruCacheFactory(java.lang.String diskCacheFolder, long diskCacheSize)
-
DiskLruCacheFactory
public DiskLruCacheFactory(java.lang.String diskCacheFolder, java.lang.String diskCacheName, long diskCacheSize)
-
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 Detail
-
build
public DiskCache build()
Description copied from interface:DiskCache.FactoryReturns a new disk cache, ornullif no disk cache could be created.- Specified by:
buildin interfaceDiskCache.Factory
-
-