X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.repo%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Frepo%2FRepoUtils.java;h=ec3d17e41e580dd8d3fe27013efa085312225452;hb=3ee2fdf1cb2047b3c4eda153ce1e9ac2b24f6f9c;hp=1aee15835ba9551a7fe5b91bdcad2190ea526ad3;hpb=1a0340b557d4cd38e763e4922a3ee4e5dcc8f6d3;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/RepoUtils.java b/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/RepoUtils.java index 1aee15835..ec3d17e41 100644 --- a/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/RepoUtils.java +++ b/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/RepoUtils.java @@ -32,6 +32,7 @@ import java.util.jar.JarFile; import java.util.jar.JarInputStream; import java.util.jar.JarOutputStream; import java.util.jar.Manifest; +import java.util.zip.ZipInputStream; import javax.jcr.Credentials; import javax.jcr.GuestCredentials; @@ -199,16 +200,20 @@ public class RepoUtils implements ArgeoNames, SlcNames { jarOut = new JarOutputStream(out, manifest); JarEntry jarEntry = null; while ((jarEntry = jarIn.getNextJarEntry()) != null) { - jarOut.putNextEntry(jarEntry); - IOUtils.copy(jarIn, jarOut); - jarIn.closeEntry(); - jarOut.closeEntry(); + if (!jarEntry.getName().equals("META-INF/MANIFEST.MF")) { + JarEntry newJarEntry = new JarEntry(jarEntry.getName()); + jarOut.putNextEntry(newJarEntry); + IOUtils.copy(jarIn, jarOut); + jarIn.closeEntry(); + jarOut.closeEntry(); + } } } catch (IOException e) { throw new SlcException("Could not copy jar with MANIFEST " + manifest.getMainAttributes(), e); } finally { - IOUtils.closeQuietly(jarIn); + if (!(in instanceof ZipInputStream)) + IOUtils.closeQuietly(jarIn); IOUtils.closeQuietly(jarOut); } }