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