Added Http Cache

Use new http request platform
This commit is contained in:
xfl03 committed 2016-11-06 12:00:36 +08:00
1 parent 87a40fc3c7
commit bdead01ef9
9 files changed
+273 -145

No files matched your search

@@ -35,11 +35,9 @@ public class HttpTextureUtil {
}
if(fakeUrl.startsWith(LOCAL_LEGACY_MARK)){
fakeUrl=fakeUrl.replaceFirst(LOCAL_LEGACY_MARK, "");
String[] t=fakeUrl.split(",",2);
if(t.length!=2)
return info;
info.cacheFile=new File(CustomSkinLoader.DATA_DIR,t[1]);
info.hash=t[0];
info.url=fakeUrl;
info.hash=DigestUtils.sha1Hex(info.url);;
info.cacheFile=HttpTextureUtil.getCacheFile(info.hash);
return info;
}
if(fakeUrl.startsWith(LOCAL_MARK)){
@@ -61,8 +59,8 @@ public class HttpTextureUtil {
return info;
}
public static String getLegacyFakeUrl(String url,String hash){
return LEGACY_MARK+hash+","+url;
public static String getLegacyFakeUrl(String url){
return LEGACY_MARK+url;
}
public static String getLocalFakeUrl(String path){
return LOCAL_MARK+path;