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
|
||||
{
|
||||
//attempt to import using Java ZipInputStream
|
||||
importZipInputStream(false);
|
||||
return importZipInputStream(false);
|
||||
}
|
||||
catch (IOException e)
|
||||
catch (Throwable t)
|
||||
{
|
||||
e.printStackTrace();
|
||||
|
||||
//fallback to apache commons ZipFile
|
||||
importApacheZipFile(false);
|
||||
try {
|
||||
//fallback to apache commons ZipFile
|
||||
return 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
|
||||
if (name.endsWith(".class"))
|
||||
addClassResource(name, stream);
|
||||
else if(!classesOnly)
|
||||
addResource(name, stream);
|
||||
|
||||
return addClassResource(name, stream);
|
||||
else if (!classesOnly)
|
||||
return addResource(name, stream);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue