use of com.koushikdutta.async.util.FileCache in project ion by koush.
the class IonBitmapRequestBuilder method isLocallyCached.
@Override
public LocallyCachedStatus isLocallyCached() {
if (builder.noCache || deepZoom)
return LocallyCachedStatus.NOT_CACHED;
final String decodeKey = computeDecodeKey();
addDefaultTransform();
String bitmapKey = computeBitmapKey(decodeKey);
BitmapInfo info = builder.ion.bitmapCache.get(bitmapKey);
// memory cache
if (info != null && info.exception == null)
return LocallyCachedStatus.CACHED;
FileCache fileCache = ion.responseCache.getFileCache();
if (hasTransforms() && fileCache.exists(bitmapKey))
return LocallyCachedStatus.CACHED;
if (fileCache.exists(decodeKey))
return LocallyCachedStatus.MAYBE_CACHED;
return LocallyCachedStatus.NOT_CACHED;
}
Aggregations