Java 类com.facebook.cache.disk.FileCache 实例源码

项目:GitHub    文件:BaseFrescoStethoPlugin.java   
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);
  }
}
项目:fresco    文件:BaseFrescoStethoPlugin.java   
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);
  }
}
项目:GitHub    文件:BufferedDiskCache.java   
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();
}
项目:GitHub    文件:ImagePipelineFactory.java   
public FileCache getMainFileCache() {
  if (mMainFileCache == null) {
    DiskCacheConfig diskCacheConfig = mConfig.getMainDiskCacheConfig();
    mMainFileCache = mConfig.getFileCacheFactory().get(diskCacheConfig);
  }
  return mMainFileCache;
}
项目:GitHub    文件:ImagePipelineFactory.java   
public FileCache getSmallImageFileCache() {
  if (mSmallImageFileCache == null) {
    DiskCacheConfig diskCacheConfig = mConfig.getSmallImageDiskCacheConfig();
    mSmallImageFileCache = mConfig.getFileCacheFactory().get(diskCacheConfig);
  }
  return mSmallImageFileCache;
}
项目:BigImageViewer    文件:FrescoImageLoader.java   
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;
}
项目:BigImageViewer-master    文件:FrescoImageLoader.java   
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;
}
项目:fresco    文件:BufferedDiskCache.java   
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();
}
项目:fresco    文件:ImagePipelineFactory.java   
public FileCache getMainFileCache() {
  if (mMainFileCache == null) {
    DiskCacheConfig diskCacheConfig = mConfig.getMainDiskCacheConfig();
    mMainFileCache = mConfig.getFileCacheFactory().get(diskCacheConfig);
  }
  return mMainFileCache;
}
项目:fresco    文件:ImagePipelineFactory.java   
public FileCache getSmallImageFileCache() {
  if (mSmallImageFileCache == null) {
    DiskCacheConfig diskCacheConfig = mConfig.getSmallImageDiskCacheConfig();
    mSmallImageFileCache = mConfig.getFileCacheFactory().get(diskCacheConfig);
  }
  return mSmallImageFileCache;
}
项目:GitHub    文件:DiskStorageCacheFactory.java   
@Override
public FileCache get(DiskCacheConfig diskCacheConfig) {
  return buildDiskStorageCache(diskCacheConfig, mDiskStorageFactory.get(diskCacheConfig));
}
项目:fresco    文件:DiskStorageCacheFactory.java   
@Override
public FileCache get(DiskCacheConfig diskCacheConfig) {
  return buildDiskStorageCache(diskCacheConfig, mDiskStorageFactory.get(diskCacheConfig));
}
项目:apps-android-wikipedia    文件:DisabledCache.java   
@Override
public FileCache get(DiskCacheConfig diskCacheConfig) {
    return new DisabledCache();
}
项目:GitHub    文件:FileCacheFactory.java   
FileCache get(DiskCacheConfig diskCacheConfig);
项目:fresco    文件:FileCacheFactory.java   
FileCache get(DiskCacheConfig diskCacheConfig);