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=9ff8f15fb9fb006a332c183382995da7af9d6d8a;hb=9814c20dc9d73ec1626e099f60229decc4ea0ab6;hp=b0e65bce51612e757daedc4265c343ad9b620f9e;hpb=1e6cf7254fb9f150251594cf0383b3b1c5210517;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 b0e65bce5..9ff8f15fb 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,7 +200,8 @@ public class RepoUtils implements ArgeoNames, SlcNames { jarOut = new JarOutputStream(out, manifest); JarEntry jarEntry = null; while ((jarEntry = jarIn.getNextJarEntry()) != null) { - jarOut.putNextEntry(jarEntry); + JarEntry newJarEntry = new JarEntry(jarEntry.getName()); + jarOut.putNextEntry(newJarEntry); IOUtils.copy(jarIn, jarOut); jarIn.closeEntry(); jarOut.closeEntry(); @@ -208,7 +210,8 @@ public class RepoUtils implements ArgeoNames, SlcNames { 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); } } @@ -483,7 +486,7 @@ public class RepoUtils implements ArgeoNames, SlcNames { /** * Write group indexes: 'binaries' lists all bundles and their versions, - * 'sources' list theire sources, and 'sdk' aggregates both. + * 'sources' list their sources, and 'sdk' aggregates both. */ public static void writeGroupIndexes(Session session, String artifactBasePath, String groupId, String version,