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