commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [1/4] commons-compress git commit: COMPRESS-385, flip jar/zip back to where they belong
Date Tue, 18 Apr 2017 14:40:46 GMT
Repository: commons-compress
Updated Branches:
  refs/heads/master 08113862c -> f05101e28


COMPRESS-385, flip jar/zip back to where they belong


Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/abf07558
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/abf07558
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/abf07558

Branch: refs/heads/master
Commit: abf07558021a0ecc50c265dcbdc5f2f99fdbeb35
Parents: 2cf5751
Author: tballison <tallison@mitre.org>
Authored: Fri Apr 14 13:05:29 2017 -0400
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Tue Apr 18 14:40:25 2017 +0200

----------------------------------------------------------------------
 .../commons/compress/archivers/ArchiveStreamFactory.java     | 8 ++++----
 .../commons/compress/archivers/ArchiveStreamFactoryTest.java | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/abf07558/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java
b/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java
index cc51458..2d43463 100644
--- a/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java
+++ b/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java
@@ -501,11 +501,11 @@ public class ArchiveStreamFactory implements ArchiveStreamProvider {
             throw new ArchiveException("IOException while reading signature.");
         }
 
-        if (JarArchiveInputStream.matches(signature, signatureLength)) {
-            return JAR;
-        } else if (ZipArchiveInputStream.matches(signature, signatureLength)) {
+        if (ZipArchiveInputStream.matches(signature, signatureLength)) {
             return ZIP;
-        } else if (ArArchiveInputStream.matches(signature, signatureLength)) {
+        } else if (JarArchiveInputStream.matches(signature, signatureLength)) {
+            return JAR;
+        } if (ArArchiveInputStream.matches(signature, signatureLength)) {
             return AR;
         } else if (CpioArchiveInputStream.matches(signature, signatureLength)) {
             return CPIO;

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/abf07558/src/test/java/org/apache/commons/compress/archivers/ArchiveStreamFactoryTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/archivers/ArchiveStreamFactoryTest.java
b/src/test/java/org/apache/commons/compress/archivers/ArchiveStreamFactoryTest.java
index 27e2790..3fafa5d 100644
--- a/src/test/java/org/apache/commons/compress/archivers/ArchiveStreamFactoryTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/ArchiveStreamFactoryTest.java
@@ -233,10 +233,10 @@ public class ArchiveStreamFactoryTest {
                 ArchiveStreamFactory.ARJ,
                 ArchiveStreamFactory.CPIO,
                 ArchiveStreamFactory.DUMP,
-                ArchiveStreamFactory.JAR,
+                //TODO-- figure out how to differentiate btwn JAR and ZIP
+ //               ArchiveStreamFactory.JAR,
                 ArchiveStreamFactory.TAR,
- //TODO-- figure out how to differentiate btwn JAR and ZIP
- //               ArchiveStreamFactory.ZIP
+                ArchiveStreamFactory.ZIP
         }) {
             assertEquals(extension, detect("bla."+extension));
         }


Mime
View raw message