mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-17 21:28:08 +00:00
fixed Cache viewer when cache directory does not exist (browser not installed)
This commit is contained in:
@@ -47,6 +47,9 @@ public class ChromeCache implements CacheImplementation {
|
||||
if (!loaded) {
|
||||
refresh();
|
||||
}
|
||||
if (!loaded) {
|
||||
return null;
|
||||
}
|
||||
List<CacheEntry> ret = new ArrayList<>();
|
||||
try {
|
||||
List<EntryStore> entries = index.getEntries();
|
||||
|
||||
@@ -34,6 +34,9 @@ public class FirefoxCache implements CacheImplementation {
|
||||
@Override
|
||||
public void refresh() {
|
||||
File dir = getCacheDirectory();
|
||||
if(dir==null){
|
||||
return;
|
||||
}
|
||||
File cacheMapFile = new File(dir, "_CACHE_MAP_");
|
||||
try {
|
||||
map = new CacheMap(cacheMapFile);
|
||||
@@ -105,6 +108,9 @@ public class FirefoxCache implements CacheImplementation {
|
||||
if (profileDir != null) {
|
||||
cacheDir = new File(profileDir, "Cache");
|
||||
}
|
||||
if(!cacheDir.exists()){
|
||||
return null;
|
||||
}
|
||||
return cacheDir;
|
||||
}
|
||||
|
||||
|
||||
@@ -147,10 +147,13 @@ public class LoadFromCacheFrame extends AppFrame implements ActionListener {
|
||||
}
|
||||
entries = new ArrayList<>();
|
||||
for (CacheImplementation c : caches) {
|
||||
for (CacheEntry en : c.getEntries()) {
|
||||
String contentType = en.getHeader("Content-Type");
|
||||
if ("application/x-shockwave-flash".equals(contentType)) {
|
||||
entries.add(en);
|
||||
List<CacheEntry> list=c.getEntries();
|
||||
if(list!=null){
|
||||
for (CacheEntry en : c.getEntries()) {
|
||||
String contentType = en.getHeader("Content-Type");
|
||||
if ("application/x-shockwave-flash".equals(contentType)) {
|
||||
entries.add(en);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user