From 575df9b9a3519186ac801a10eb632e0e2b4ddbdd Mon Sep 17 00:00:00 2001 From: Michael Simacek Date: Mon, 12 Feb 2018 10:59:55 +0100 Subject: [PATCH 2/3] Remove ZSTD compressor --- .../compressors/CompressorStreamFactory.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java index 95b6e45..16bc88e 100644 --- a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java +++ b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java @@ -53,9 +53,6 @@ import org.apache.commons.compress.compressors.xz.XZCompressorInputStream; import org.apache.commons.compress.compressors.xz.XZCompressorOutputStream; import org.apache.commons.compress.compressors.xz.XZUtils; import org.apache.commons.compress.compressors.z.ZCompressorInputStream; -import org.apache.commons.compress.compressors.zstandard.ZstdCompressorInputStream; -import org.apache.commons.compress.compressors.zstandard.ZstdCompressorOutputStream; -import org.apache.commons.compress.compressors.zstandard.ZstdUtils; import org.apache.commons.compress.utils.IOUtils; import org.apache.commons.compress.utils.Sets; @@ -297,10 +294,6 @@ public class CompressorStreamFactory implements CompressorStreamProvider { return LZ4_FRAMED; } - if (compressorNames.contains(ZSTANDARD) && ZstdUtils.matches(signature, signatureLength)) { - return ZSTANDARD; - } - throw new CompressorException("No Compressor found for the stream signature."); } @@ -615,10 +608,7 @@ public class CompressorStreamFactory implements CompressorStreamProvider { } if (ZSTANDARD.equalsIgnoreCase(name)) { - if (!ZstdUtils.isZstdCompressionAvailable()) { - throw new CompressorException("Zstandard compression is not available." + YOU_NEED_ZSTD_JNI); - } - return new ZstdCompressorInputStream(in); + throw new CompressorException("Zstandard compression is not available in this build."); } if (LZMA.equalsIgnoreCase(name)) { @@ -734,7 +724,7 @@ public class CompressorStreamFactory implements CompressorStreamProvider { } if (ZSTANDARD.equalsIgnoreCase(name)) { - return new ZstdCompressorOutputStream(out); + throw new CompressorException("Zstandard compression is not available in this build."); } } catch (final IOException e) { throw new CompressorException("Could not create CompressorOutputStream", e); -- 2.43.0