Commit f7d1f968 authored by Andy Wilkinson's avatar Andy Wilkinson

Improve error message when JarFile encounters a compressed nested jar

Closes gh-1643
parent 79deed7e
...@@ -375,8 +375,10 @@ public class JarFile extends java.util.jar.JarFile implements Iterable<JarEntryD ...@@ -375,8 +375,10 @@ public class JarFile extends java.util.jar.JarFile implements Iterable<JarEntryD
private JarFile createJarFileFromFileEntry(JarEntryData sourceEntry) private JarFile createJarFileFromFileEntry(JarEntryData sourceEntry)
throws IOException { throws IOException {
if (sourceEntry.getMethod() != ZipEntry.STORED) { if (sourceEntry.getMethod() != ZipEntry.STORED) {
throw new IllegalStateException("Unable to open nested compressed entry " throw new IllegalStateException("Unable to open nested entry '"
+ sourceEntry.getName()); + sourceEntry.getName() + "'. It has been compressed and nested "
+ "jar files must be stored without compression. Please check the "
+ "mechanism used to create your executable jar file");
} }
return new JarFile(this.rootFile, this.pathFromRoot + "!/" return new JarFile(this.rootFile, this.pathFromRoot + "!/"
+ sourceEntry.getName(), sourceEntry.getData()); + sourceEntry.getName(), sourceEntry.getData());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment