commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1573526 - in /commons/proper/compress/trunk/src: changes/changes.xml main/java/org/apache/commons/compress/archivers/sevenz/Coders.java
Date Mon, 03 Mar 2014 11:18:00 GMT
Author: bodewig
Date: Mon Mar  3 11:17:59 2014
New Revision: 1573526

URL: http://svn.apache.org/r1573526
Log:
COMPRESS-257 turn error thrown by XZ into a more useful exception

Modified:
    commons/proper/compress/trunk/src/changes/changes.xml
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/sevenz/Coders.java

Modified: commons/proper/compress/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/changes/changes.xml?rev=1573526&r1=1573525&r2=1573526&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/changes/changes.xml (original)
+++ commons/proper/compress/trunk/src/changes/changes.xml Mon Mar  3 11:17:59 2014
@@ -100,6 +100,11 @@ The <action> type attribute can be add,u
       <action type="add" date="2014-02-28">
         The 7z package now supports the delta filter as method.
       </action>
+      <action issue="COMPRESS-257" type="add" date="2014-03-03">
+        The 7z package now supports BCJ filters for several platforms.
+        You will need a version of XZ for Java > 1.4 to read archives
+        using BCJ, though.
+      </action>
     </release>
     <release version="1.7" date="2014-01-20"
              description="Release 1.7">

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/sevenz/Coders.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/sevenz/Coders.java?rev=1573526&r1=1573525&r2=1573526&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/sevenz/Coders.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/sevenz/Coders.java
Mon Mar  3 11:17:59 2014
@@ -123,7 +123,14 @@ class Coders {
         @Override
         InputStream decode(final InputStream in, final Coder coder,
                 byte[] password) throws IOException {
-            return opts.getInputStream(in);
+            try {
+                return opts.getInputStream(in);
+            } catch (AssertionError e) {
+                IOException ex = new IOException("BCJ filter needs XZ for Java > 1.4 -
see "
+                                                 + "http://commons.apache.org/proper/commons-compress/limitations.html#7Z");
+                ex.initCause(e);
+                throw ex;
+            }
         }
         @Override
         OutputStream encode(final OutputStream out, final Object _) {



Mime
View raw message