Improve exception messages on nested jar failure

Updates gh-284
This commit is contained in:
Phillip Webb 2014-01-29 23:00:20 -08:00
parent 14bc06a387
commit 3e7af3ddb8

View File

@ -305,10 +305,16 @@ public class JarFile extends java.util.jar.JarFile implements Iterable<JarEntryD
*/
public synchronized JarFile getNestedJarFile(final JarEntryData sourceEntry,
JarEntryFilter... filters) throws IOException {
if (sourceEntry.isDirectory()) {
return getNestedJarFileFromDirectoryEntry(sourceEntry, filters);
try {
if (sourceEntry.isDirectory()) {
return getNestedJarFileFromDirectoryEntry(sourceEntry, filters);
}
return getNestedJarFileFromFileEntry(sourceEntry, filters);
}
catch (IOException ex) {
throw new IOException("Unable to open nested jar file '"
+ sourceEntry.getName() + "'", ex);
}
return getNestedJarFileFromFileEntry(sourceEntry, filters);
}
private JarFile getNestedJarFileFromDirectoryEntry(JarEntryData sourceEntry,