e13284
From 575df9b9a3519186ac801a10eb632e0e2b4ddbdd Mon Sep 17 00:00:00 2001
e13284
From: Michael Simacek <msimacek@redhat.com>
e13284
Date: Mon, 12 Feb 2018 10:59:55 +0100
e13284
Subject: [PATCH 2/3] Remove ZSTD compressor
e13284
e13284
---
e13284
 .../compressors/CompressorStreamFactory.java       | 14 ++------------
e13284
 1 file changed, 2 insertions(+), 12 deletions(-)
e13284
e13284
diff --git a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
e13284
index 0f1394f..eee7c31 100644
e13284
--- a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
e13284
+++ b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
e13284
@@ -54,9 +54,6 @@ import org.apache.commons.compress.compressors.xz.XZCompressorInputStream;
e13284
 import org.apache.commons.compress.compressors.xz.XZCompressorOutputStream;
e13284
 import org.apache.commons.compress.compressors.xz.XZUtils;
e13284
 import org.apache.commons.compress.compressors.z.ZCompressorInputStream;
e13284
-import org.apache.commons.compress.compressors.zstandard.ZstdCompressorInputStream;
e13284
-import org.apache.commons.compress.compressors.zstandard.ZstdCompressorOutputStream;
e13284
-import org.apache.commons.compress.compressors.zstandard.ZstdUtils;
e13284
 import org.apache.commons.compress.utils.IOUtils;
e13284
 import org.apache.commons.compress.utils.Lists;
e13284
 import org.apache.commons.compress.utils.ServiceLoaderIterator;
e13284
@@ -509,10 +506,6 @@ public class CompressorStreamFactory implements CompressorStreamProvider {
e13284
             return LZ4_FRAMED;
e13284
         }
e13284
 
e13284
-        if (ZstdUtils.matches(signature, signatureLength)) {
e13284
-            return ZSTANDARD;
e13284
-        }
e13284
-
e13284
         throw new CompressorException("No Compressor found for the stream signature.");
e13284
     }
e13284
     /**
e13284
@@ -588,10 +581,7 @@ public class CompressorStreamFactory implements CompressorStreamProvider {
e13284
             }
e13284
 
e13284
             if (ZSTANDARD.equalsIgnoreCase(name)) {
e13284
-                if (!ZstdUtils.isZstdCompressionAvailable()) {
e13284
-                    throw new CompressorException("Zstandard compression is not available." + YOU_NEED_ZSTD_JNI);
e13284
-                }
e13284
-                return new ZstdCompressorInputStream(in);
e13284
+                throw new CompressorException("Zstandard compression is not available in this build.");
e13284
             }
e13284
 
e13284
             if (LZMA.equalsIgnoreCase(name)) {
e13284
@@ -707,7 +697,7 @@ public class CompressorStreamFactory implements CompressorStreamProvider {
e13284
             }
e13284
 
e13284
             if (ZSTANDARD.equalsIgnoreCase(name)) {
e13284
-                return new ZstdCompressorOutputStream(out);
e13284
+                throw new CompressorException("Zstandard compression is not available in this build.");
e13284
             }
e13284
         } catch (final IOException e) {
e13284
             throw new CompressorException("Could not create CompressorOutputStream", e);
e13284
-- 
e13284
2.20.1
e13284