
com.azcltd.fluffyimageloader.cache.DefaultCacheKeyGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fluffy-image-loader Show documentation
Show all versions of fluffy-image-loader Show documentation
Library that helps loading and caching images in Android applications
The newest version!
package com.azcltd.fluffyimageloader.cache;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
public class DefaultCacheKeyGenerator implements ICacheKeyGenerator {
@Override
public String toCacheKey(String uri) {
if (uri == null) return null;
try {
String lastPart = uri.substring(uri.lastIndexOf("/") + 1);
String name = uri.hashCode() + '-' + URLEncoder.encode(lastPart, "UTF-8");
return name.replace('%', '_'); // To use in other Uri (avoid encoding)
} catch (UnsupportedEncodingException e) {
return null;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy