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