Permalink
Browse files

Allow duplicate entries to be ignored

  • Loading branch information...
1 parent c86a33b commit 2df8dde80442150c7c061f237bf26e3617a446a4 Stuart McCulloch committed Jul 8, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/main/java/com/tonicsystems/jarjar/util/StandaloneJarProcessor.java
@@ -27,6 +27,9 @@
public class StandaloneJarProcessor
{
public static void run(File from, File to, JarProcessor proc) throws IOException {
+ run(from, to, proc, false);
+ }
+ public static void run(File from, File to, JarProcessor proc, boolean ignoreDuplicates) throws IOException {
byte[] buf = new byte[0x2000];
File tmp = null;
if (from.equals(to)) {
@@ -56,7 +59,7 @@ public static void run(File from, File to, JarProcessor proc) throws IOException
out.write(struct.data);
} else if (struct.name.endsWith("/")) {
// TODO(chrisn): log
- } else {
+ } else if (!ignoreDuplicates) {
throw new IllegalArgumentException("Duplicate jar entries: " + struct.name);
}
}

0 comments on commit 2df8dde

Please sign in to comment.