public interface

DiskCachePolicy

com.facebook.imagepipeline.cache.DiskCachePolicy
Known Indirect Subclasses

Class Overview

Policy on how to read from and write to the image disk cache.

This is useful to separate from the producers how to decide which disk cache(s) to use, whether the main or small cache, and also which precise cache key(s) to look for.

Summary

Public Methods
abstract Task<EncodedImage> createAndStartCacheReadTask(ImageRequest imageRequest, Object callerContext, AtomicBoolean isCancelled)
Creates and starts the task to carry out a disk cache read, using whichever caches and keys are appropriate for this policy.
abstract ImageRequest.CacheChoice getCacheChoiceForResult(ImageRequest imageRequest, EncodedImage encodedImage)
Determines the cache in which to store the provided image.
abstract void writeToCache(EncodedImage newResult, ImageRequest imageRequest, Object callerContext)
Writes the new image data to whichever cache and with whichever key is appropriate for this policy.

Public Methods

public abstract Task<EncodedImage> createAndStartCacheReadTask (ImageRequest imageRequest, Object callerContext, AtomicBoolean isCancelled)

Creates and starts the task to carry out a disk cache read, using whichever caches and keys are appropriate for this policy.

public abstract ImageRequest.CacheChoice getCacheChoiceForResult (ImageRequest imageRequest, EncodedImage encodedImage)

Determines the cache in which to store the provided image.

Parameters
imageRequest request which resulted in loading the image
encodedImage the image to store in cache
Returns
  • cache choice that represents the cache to use

public abstract void writeToCache (EncodedImage newResult, ImageRequest imageRequest, Object callerContext)

Writes the new image data to whichever cache and with whichever key is appropriate for this policy.