fresco
fresco copied to clipboard
Through a network url, get local cache file path
if you mean by the file path for downloaded images in Bitmap cache/Disk cache, they don't have file path as they're not real file
There is no way to get to the local cache file path?
May I ask why do you need to get the local cache file path?
@aagnes I need to be stored or forwarded pictures
File getDiskCacheFile(String url) {
ImageRequest imageRequest = ImageRequest.fromUri(url);
CacheKey cacheKey = DefaultCacheKeyFactory.getInstance()
.getEncodedCacheKey(imageRequest);
BinaryResource resource = Fresco.getImagePipelineFactory()
.getMainDiskStorageCache()
.getResource(cacheKey);
if (resource instanceof FileBinaryResource) {
return ((FileBinaryResource) resource).getFile();
}
return null;
}