Retry zip files more aggressively
This doesn't fix any issue, but may be useful in some cases, I guess?
This commit is contained in:
parent
6e6502b300
commit
b507667c75
1 changed files with 13 additions and 11 deletions
|
@ -73,16 +73,18 @@ public class ResourceContainerImporter
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//attempt to import using Java ZipInputStream
|
//attempt to import using Java ZipInputStream
|
||||||
importZipInputStream(false);
|
return importZipInputStream(false);
|
||||||
}
|
}
|
||||||
catch (IOException e)
|
catch (Throwable t)
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
try {
|
||||||
|
//fallback to apache commons ZipFile
|
||||||
//fallback to apache commons ZipFile
|
return importApacheZipFile(false);
|
||||||
importApacheZipFile(false);
|
} catch (Throwable t1) {
|
||||||
|
t1.addSuppressed(t);
|
||||||
|
throw t1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -93,10 +95,10 @@ public class ResourceContainerImporter
|
||||||
{
|
{
|
||||||
//TODO remove this .class check and just look for cafebabe
|
//TODO remove this .class check and just look for cafebabe
|
||||||
if (name.endsWith(".class"))
|
if (name.endsWith(".class"))
|
||||||
addClassResource(name, stream);
|
return addClassResource(name, stream);
|
||||||
else if(!classesOnly)
|
else if (!classesOnly)
|
||||||
addResource(name, stream);
|
return addResource(name, stream);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue