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