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;
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();
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);
}
}
/**
* 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,