From 0c348ec17e89d8666b8160db48b03fb68e7358f4 Mon Sep 17 00:00:00 2001 From: zzz <zzz@mail.i2p> Date: Sat, 17 Mar 2012 21:56:20 +0000 Subject: [PATCH] * FileUtil: Better logging of weird unpack200 errors --- core/java/src/net/i2p/util/FileUtil.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/java/src/net/i2p/util/FileUtil.java b/core/java/src/net/i2p/util/FileUtil.java index c47a5a31bf..27e95bee71 100644 --- a/core/java/src/net/i2p/util/FileUtil.java +++ b/core/java/src/net/i2p/util/FileUtil.java @@ -147,9 +147,12 @@ public class FileUtil { System.getProperty("java.version")); ioe.printStackTrace(); return false; - } catch (Exception e) { // ClassNotFoundException but compiler not happy with that - System.err.println("ERROR: Error unpacking the zip entry (" + entry.getName() + - "), your JVM does not support unpack200"); + } catch (Exception e) { + // Oracle unpack() should throw an IOE but other problems can happen, e.g: + // java.lang.reflect.InvocationTargetException + // Caused by: java.util.zip.ZipException: duplicate entry: xxxxx + System.err.println("ERROR: Error extracting the zip entry (" + entry.getName() + ')'); + e.printStackTrace(); return false; } finally { try { if (in != null) in.close(); } catch (IOException ioe) {} @@ -261,6 +264,7 @@ public class FileUtil { * @throws IOException on unpack error or if neither library is available. * Will not throw ClassNotFoundException. * @throws org.apache.harmony.pack200.Pack200Exception which is not an IOException + * @throws java.lang.reflect.InvocationTargetException on duplicate zip entries in the packed jar * @since 0.8.1 */ private static void unpack(InputStream in, JarOutputStream out) throws Exception { -- GitLab