summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
diff options
context:
space:
mode:
authorShawn Pearce <sop@google.com>2012-12-04 18:28:20 -0500
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2012-12-04 18:28:20 -0500
commit72ee3280e08ef9d4a99466f0dbd29f419b5445b7 (patch)
treea4b7e621fe428ddd7cedce36b122004a17c3d9f7 /org.eclipse.jgit.pgm
parente9a1df6c5635220f7c44e582d7370b92a164c9cd (diff)
parent1547eaf7c57e93b3ff7fb9d2450fe3e87ba614ed (diff)
downloadjgit-72ee3280e08ef9d4a99466f0dbd29f419b5445b7.tar.gz
jgit-72ee3280e08ef9d4a99466f0dbd29f419b5445b7.zip
Merge "[RFC] archive: Switch to commons-compress as ZIP archiver"
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r--org.eclipse.jgit.pgm/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.jgit.pgm/pom.xml5
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Archive.java11
3 files changed, 13 insertions, 6 deletions
diff --git a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
index df026e02cb..57b59afbc0 100644
--- a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
@@ -6,7 +6,8 @@ Bundle-Version: 2.2.0.qualifier
Bundle-Vendor: %provider_name
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Import-Package: org.eclipse.jgit.api;version="[2.2.0,2.3.0)",
+Import-Package: org.apache.commons.compress.archivers.zip;version="[1.3,2.0)",
+ org.eclipse.jgit.api;version="[2.2.0,2.3.0)",
org.eclipse.jgit.api.errors;version="[2.2.0,2.3.0)",
org.eclipse.jgit.awtui;version="[2.2.0,2.3.0)",
org.eclipse.jgit.blame;version="[2.2.0,2.3.0)",
diff --git a/org.eclipse.jgit.pgm/pom.xml b/org.eclipse.jgit.pgm/pom.xml
index 02d346365a..5cf108420d 100644
--- a/org.eclipse.jgit.pgm/pom.xml
+++ b/org.eclipse.jgit.pgm/pom.xml
@@ -72,6 +72,11 @@
</dependency>
<dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-compress</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>${project.version}</version>
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Archive.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Archive.java
index 786524eca2..ec937a3cc3 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Archive.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Archive.java
@@ -46,9 +46,9 @@ package org.eclipse.jgit.pgm;
import java.lang.String;
import java.lang.System;
import java.text.MessageFormat;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
+import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
+import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.eclipse.jgit.lib.FileMode;
import org.eclipse.jgit.lib.MutableObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
@@ -69,7 +69,7 @@ class Archive extends TextBuiltin {
final TreeWalk walk = new TreeWalk(db);
final ObjectReader reader = walk.getObjectReader();
final MutableObjectId idBuf = new MutableObjectId();
- final ZipOutputStream out = new ZipOutputStream(outs);
+ final ZipArchiveOutputStream out = new ZipArchiveOutputStream(outs);
if (tree == null)
throw die(CLIText.get().treeIsRequired);
@@ -87,11 +87,12 @@ class Archive extends TextBuiltin {
continue;
walk.getObjectId(idBuf, 0);
- final ZipEntry entry = new ZipEntry(name);
+ final ZipArchiveEntry entry = new ZipArchiveEntry(name);
final ObjectLoader loader = reader.open(idBuf);
entry.setSize(loader.getSize());
- out.putNextEntry(entry);
+ out.putArchiveEntry(entry);
loader.copyTo(out);
+ out.closeArchiveEntry();
if (mode != FileMode.REGULAR_FILE)
System.err.println(MessageFormat.format( //