You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2014/03/03 12:18:00 UTC

svn commit: r1573526 - in /commons/proper/compress/trunk/src: changes/changes.xml main/java/org/apache/commons/compress/archivers/sevenz/Coders.java

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 _) {