private void diskcache(FileCache cache, String title, PrintStream writer, List<String> args) throws DumpException { DiskStorage.DiskDumpInfo intDiskDumpInfo; try { intDiskDumpInfo = cache.getDumpInfo(); } catch (IOException e) { throw new DumpException(e.getMessage()); } if (!args.isEmpty() && args.get(0).equals("-s")) { writeDiskDumpInfoScriptReadable(writer, intDiskDumpInfo); } else { writer.println(); writer.println(title + " disk cache contents:"); writeDiskDumpInfo(writer, intDiskDumpInfo); } }
public BufferedDiskCache( FileCache fileCache, PooledByteBufferFactory pooledByteBufferFactory, PooledByteStreams pooledByteStreams, Executor readExecutor, Executor writeExecutor, ImageCacheStatsTracker imageCacheStatsTracker) { mFileCache = fileCache; mPooledByteBufferFactory = pooledByteBufferFactory; mPooledByteStreams = pooledByteStreams; mReadExecutor = readExecutor; mWriteExecutor = writeExecutor; mImageCacheStatsTracker = imageCacheStatsTracker; mStagingArea = StagingArea.getInstance(); }
public FileCache getMainFileCache() { if (mMainFileCache == null) { DiskCacheConfig diskCacheConfig = mConfig.getMainDiskCacheConfig(); mMainFileCache = mConfig.getFileCacheFactory().get(diskCacheConfig); } return mMainFileCache; }
public FileCache getSmallImageFileCache() { if (mSmallImageFileCache == null) { DiskCacheConfig diskCacheConfig = mConfig.getSmallImageDiskCacheConfig(); mSmallImageFileCache = mConfig.getFileCacheFactory().get(diskCacheConfig); } return mSmallImageFileCache; }
private File getCacheFile(final ImageRequest request) { FileCache mainFileCache = ImagePipelineFactory .getInstance() .getMainFileCache(); final CacheKey cacheKey = DefaultCacheKeyFactory .getInstance() .getEncodedCacheKey(request, false); // we don't need context, but avoid null File cacheFile = request.getSourceFile(); // http://crashes.to/s/ee10638fb31 if (mainFileCache.hasKey(cacheKey) && mainFileCache.getResource(cacheKey) != null) { cacheFile = ((FileBinaryResource) mainFileCache.getResource(cacheKey)).getFile(); } return cacheFile; }
private File getCacheFile(final ImageRequest request) { FileCache mainFileCache = ImagePipelineFactory .getInstance() .getMainFileCache(); final CacheKey cacheKey = DefaultCacheKeyFactory .getInstance() .getEncodedCacheKey(request, false); // we don't need context, but avoid null File cacheFile = request.getSourceFile(); if (mainFileCache.hasKey(cacheKey)) { cacheFile = ((FileBinaryResource) mainFileCache.getResource(cacheKey)).getFile(); } return cacheFile; }
@Override public FileCache get(DiskCacheConfig diskCacheConfig) { return buildDiskStorageCache(diskCacheConfig, mDiskStorageFactory.get(diskCacheConfig)); }
@Override public FileCache get(DiskCacheConfig diskCacheConfig) { return new DisabledCache(); }
FileCache get(DiskCacheConfig diskCacheConfig);