From 77d08229cd95cc948a19996faa8515e0d77d7930 Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Fri, 6 Aug 2021 13:42:40 +0200 Subject: [PATCH 3/3] Remove Pack200 compressor --- .../compress/compressors/CompressorStreamFactory.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 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 9ed40a3d7..565aa519e 100644 --- a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java +++ b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java @@ -44,8 +44,6 @@ import org.apache.commons.compress.compressors.lzma.LZMACompressorInputStream; import org.apache.commons.compress.compressors.lzma.LZMACompressorOutputStream; import org.apache.commons.compress.compressors.lzma.LZMAUtils; -import org.apache.commons.compress.compressors.pack200.Pack200CompressorInputStream; -import org.apache.commons.compress.compressors.pack200.Pack200CompressorOutputStream; import org.apache.commons.compress.compressors.snappy.FramedSnappyCompressorInputStream; import org.apache.commons.compress.compressors.snappy.FramedSnappyCompressorOutputStream; import org.apache.commons.compress.compressors.snappy.SnappyCompressorInputStream; @@ -249,10 +247,6 @@ static String detect(final InputStream inputStream, final Set compressor return GZIP; } - if (compressorNames.contains(PACK200) && Pack200CompressorInputStream.matches(signature, signatureLength)) { - return PACK200; - } - if (compressorNames.contains(SNAPPY_FRAMED) && FramedSnappyCompressorInputStream.matches(signature, signatureLength)) { return SNAPPY_FRAMED; } @@ -554,7 +548,7 @@ public CompressorInputStream createCompressorInputStream(final String name, fina } if (PACK200.equalsIgnoreCase(name)) { - return new Pack200CompressorInputStream(in); + throw new CompressorException("Pack200 compression is not available in this build."); } if (SNAPPY_RAW.equalsIgnoreCase(name)) { @@ -627,7 +621,7 @@ public CompressorOutputStream createCompressorOutputStream(final String name, fi } if (PACK200.equalsIgnoreCase(name)) { - return new Pack200CompressorOutputStream(out); + throw new CompressorException("Pack200 compression is not available in this build."); } if (LZMA.equalsIgnoreCase(name)) { -- 2.43.0