[Reproducible-builds] [sortjar] 03/05: Switched from ZipOutputStream to JarOutputStream.
Drew Fisher
zarvox-guest at moszumanska.debian.org
Sat Aug 30 18:43:10 UTC 2014
This is an automated email from the git hooks/post-receive script.
zarvox-guest pushed a commit to branch master
in repository sortjar.
commit cfa1f687a376ecadf7568b575219ae80063284ac
Author: akwizgran <akwizgran at users.sourceforge.net>
Date: Thu Apr 17 17:29:51 2014 +0100
Switched from ZipOutputStream to JarOutputStream.
Apparently JarOutputStream writes a magic value indicating a jar file:
https://wiki.debian.org/ReproducibleBuilds/TimestampInJarFiles
---
src/org/briarproject/sortjar/SortJar.java | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/org/briarproject/sortjar/SortJar.java b/src/org/briarproject/sortjar/SortJar.java
index db39bb1..0956f10 100644
--- a/src/org/briarproject/sortjar/SortJar.java
+++ b/src/org/briarproject/sortjar/SortJar.java
@@ -6,9 +6,9 @@ import java.io.InputStream;
import java.util.Collections;
import java.util.Map;
import java.util.TreeMap;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-import java.util.zip.ZipOutputStream;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.util.jar.JarOutputStream;
public class SortJar {
@@ -20,15 +20,15 @@ public class SortJar {
String input = args[0], output = args[1];
try {
// Read and sort the entries
- Map<String, ZipEntry> entries = new TreeMap<String, ZipEntry>();
- ZipFile in = new ZipFile(input);
- for(ZipEntry e : Collections.list(in.entries()))
+ Map<String, JarEntry> entries = new TreeMap<String, JarEntry>();
+ JarFile in = new JarFile(input);
+ for(JarEntry e : Collections.list(in.entries()))
entries.put(e.getName(), e);
// Write the sorted entries
- ZipOutputStream out = new ZipOutputStream(
+ JarOutputStream out = new JarOutputStream(
new FileOutputStream(output));
- for(ZipEntry e : entries.values()) {
- ZipEntry e1 = new ZipEntry(e.getName());
+ for(JarEntry e : entries.values()) {
+ JarEntry e1 = new JarEntry(e.getName());
e1.setTime(0);
out.putNextEntry(e1);
InputStream entryIn = in.getInputStream(e);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/sortjar.git
More information about the Reproducible-builds
mailing list