]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/RepoUtils.java
Manage automatically *-sources.jar sources
[gpl/argeo-slc.git] / runtime / org.argeo.slc.repo / src / main / java / org / argeo / slc / repo / RepoUtils.java
index b0e65bce51612e757daedc4265c343ad9b620f9e..da4c35a99eb562a871812d8c009a5d2ccebe8296 100644 (file)
@@ -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;
@@ -208,7 +209,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 +485,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,