public class DiskLruCacheFactory extends Object implements DiskCache.Factory
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.
限定符和类型 | 类和说明 |
---|---|
static interface |
DiskLruCacheFactory.CacheDirectoryGetter
Interface called out of UI thread to get the cache folder.
|
DEFAULT_DISK_CACHE_DIR, DEFAULT_DISK_CACHE_SIZE
构造器和说明 |
---|
DiskLruCacheFactory(DiskLruCacheFactory.CacheDirectoryGetter cacheDirectoryGetter,
long diskCacheSize)
When using this constructor
DiskLruCacheFactory.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) |
public DiskLruCacheFactory(String diskCacheFolder, long diskCacheSize)
public DiskLruCacheFactory(String diskCacheFolder, String diskCacheName, long diskCacheSize)
public DiskLruCacheFactory(DiskLruCacheFactory.CacheDirectoryGetter cacheDirectoryGetter, long diskCacheSize)
DiskLruCacheFactory.CacheDirectoryGetter.getCacheDirectory()
will be called out
of UI thread, allowing to do I/O access without performance impacts.cacheDirectoryGetter
- Interface called out of UI thread to get the cache folder.diskCacheSize
- Desired max bytes size for the LRU disk cache.public DiskCache build()
DiskCache.Factory
null
if no disk cache could be created.build
在接口中 DiskCache.Factory