forked from pool/apache-commons-compress
Accepting request 1148035 from Java:packages
rpm 4.20 compat OBS-URL: https://build.opensuse.org/request/show/1148035 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/apache-commons-compress?expand=0&rev=6
This commit is contained in:
commit
da81879fa6
@ -1,17 +1,17 @@
|
|||||||
From bba585e9e4fdfc67de3b53b58b8d60923e1ccd0c Mon Sep 17 00:00:00 2001
|
From 0b10cc9b13fa782b7e318fdbc0d8c790a472f722 Mon Sep 17 00:00:00 2001
|
||||||
From: Michael Simacek <msimacek@redhat.com>
|
From: Michael Simacek <msimacek@redhat.com>
|
||||||
Date: Mon, 12 Feb 2018 10:53:48 +0100
|
Date: Mon, 12 Feb 2018 10:53:48 +0100
|
||||||
Subject: [PATCH 1/2] Remove Brotli compressor
|
Subject: [PATCH 1/3] Remove Brotli compressor
|
||||||
|
|
||||||
---
|
---
|
||||||
.../commons/compress/compressors/CompressorStreamFactory.java | 7 +------
|
.../compress/compressors/CompressorStreamFactory.java | 7 +------
|
||||||
1 file changed, 1 insertion(+), 6 deletions(-)
|
1 file changed, 1 insertion(+), 6 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
|
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 d730b9d..ab178a9 100644
|
index ca0973095..2406d5a44 100644
|
||||||
--- a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
|
--- a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
|
||||||
+++ b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
|
+++ b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
|
||||||
@@ -31,8 +31,6 @@ import java.util.Set;
|
@@ -30,8 +30,6 @@
|
||||||
import java.util.SortedMap;
|
import java.util.SortedMap;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ index d730b9d..ab178a9 100644
|
|||||||
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
|
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
|
||||||
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream;
|
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream;
|
||||||
import org.apache.commons.compress.compressors.deflate.DeflateCompressorInputStream;
|
import org.apache.commons.compress.compressors.deflate.DeflateCompressorInputStream;
|
||||||
@@ -586,10 +584,7 @@ public class CompressorStreamFactory implements CompressorStreamProvider {
|
@@ -545,10 +543,7 @@ public CompressorInputStream createCompressorInputStream(final String name, fina
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BROTLI.equalsIgnoreCase(name)) {
|
if (BROTLI.equalsIgnoreCase(name)) {
|
||||||
@ -33,5 +33,5 @@ index d730b9d..ab178a9 100644
|
|||||||
|
|
||||||
if (XZ.equalsIgnoreCase(name)) {
|
if (XZ.equalsIgnoreCase(name)) {
|
||||||
--
|
--
|
||||||
2.14.3
|
2.43.0
|
||||||
|
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
From bab91e014f73296a8ac9a3aef2aaa324a85e9b96 Mon Sep 17 00:00:00 2001
|
From d80b7b190c789c33a15f56613a21c44827a63c75 Mon Sep 17 00:00:00 2001
|
||||||
From: Michael Simacek <msimacek@redhat.com>
|
From: Michael Simacek <msimacek@redhat.com>
|
||||||
Date: Mon, 12 Feb 2018 10:59:55 +0100
|
Date: Mon, 12 Feb 2018 10:59:55 +0100
|
||||||
Subject: [PATCH 2/2] Remove ZSTD compressor
|
Subject: [PATCH 2/3] Remove ZSTD compressor
|
||||||
|
|
||||||
---
|
---
|
||||||
.../compress/compressors/CompressorStreamFactory.java | 14 ++------------
|
.../compressors/CompressorStreamFactory.java | 22 ++++---------------
|
||||||
1 file changed, 2 insertions(+), 12 deletions(-)
|
1 file changed, 4 insertions(+), 18 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
|
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 ab178a9..3817704 100644
|
index 2406d5a44..9ed40a3d7 100644
|
||||||
--- a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
|
--- a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
|
||||||
+++ b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
|
+++ b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
|
||||||
@@ -54,9 +54,6 @@ import org.apache.commons.compress.compressors.xz.XZCompressorInputStream;
|
@@ -53,9 +53,6 @@
|
||||||
import org.apache.commons.compress.compressors.xz.XZCompressorOutputStream;
|
import org.apache.commons.compress.compressors.xz.XZCompressorOutputStream;
|
||||||
import org.apache.commons.compress.compressors.xz.XZUtils;
|
import org.apache.commons.compress.compressors.xz.XZUtils;
|
||||||
import org.apache.commons.compress.compressors.z.ZCompressorInputStream;
|
import org.apache.commons.compress.compressors.z.ZCompressorInputStream;
|
||||||
@ -19,20 +19,40 @@ index ab178a9..3817704 100644
|
|||||||
-import org.apache.commons.compress.compressors.zstandard.ZstdCompressorOutputStream;
|
-import org.apache.commons.compress.compressors.zstandard.ZstdCompressorOutputStream;
|
||||||
-import org.apache.commons.compress.compressors.zstandard.ZstdUtils;
|
-import org.apache.commons.compress.compressors.zstandard.ZstdUtils;
|
||||||
import org.apache.commons.compress.utils.IOUtils;
|
import org.apache.commons.compress.utils.IOUtils;
|
||||||
import org.apache.commons.compress.utils.Lists;
|
import org.apache.commons.compress.utils.Sets;
|
||||||
import org.apache.commons.compress.utils.ServiceLoaderIterator;
|
|
||||||
@@ -516,10 +513,6 @@ public class CompressorStreamFactory implements CompressorStreamProvider {
|
@@ -280,10 +277,6 @@ static String detect(final InputStream inputStream, final Set<String> compressor
|
||||||
return LZ4_FRAMED;
|
return LZ4_FRAMED;
|
||||||
}
|
}
|
||||||
|
|
||||||
- if (ZstdUtils.matches(signature, signatureLength)) {
|
- if (compressorNames.contains(ZSTANDARD) && ZstdUtils.matches(signature, signatureLength)) {
|
||||||
- return ZSTANDARD;
|
- return ZSTANDARD;
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
throw new CompressorException("No Compressor found for the stream signature.");
|
throw new CompressorException("No Compressor found for the stream signature.");
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
@@ -595,10 +588,7 @@ public class CompressorStreamFactory implements CompressorStreamProvider {
|
@@ -405,10 +398,6 @@ public static String getZ() {
|
||||||
|
return Z;
|
||||||
|
}
|
||||||
|
|
||||||
|
- public static String getZstandard() {
|
||||||
|
- return ZSTANDARD;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
static void putAll(final Set<String> names, final CompressorStreamProvider provider, final TreeMap<String, CompressorStreamProvider> map) {
|
||||||
|
names.forEach(name -> map.put(toKey(name), provider));
|
||||||
|
}
|
||||||
|
@@ -513,7 +502,7 @@ public CompressorInputStream createCompressorInputStream(final InputStream in, f
|
||||||
|
* Creates a compressor input stream from a compressor name and an input stream.
|
||||||
|
*
|
||||||
|
* @param name of the compressor, i.e. {@value #GZIP}, {@value #BZIP2}, {@value #XZ}, {@value #LZMA}, {@value #PACK200}, {@value #SNAPPY_RAW},
|
||||||
|
- * {@value #SNAPPY_FRAMED}, {@value #Z}, {@value #LZ4_BLOCK}, {@value #LZ4_FRAMED}, {@value #ZSTANDARD}, {@value #DEFLATE64} or
|
||||||
|
+ * {@value #SNAPPY_FRAMED}, {@value #Z}, {@value #LZ4_BLOCK}, {@value #LZ4_FRAMED}, {@value #DEFLATE64} or
|
||||||
|
* {@value #DEFLATE}
|
||||||
|
* @param in the input stream
|
||||||
|
* @return compressor input stream
|
||||||
|
@@ -554,10 +543,7 @@ public CompressorInputStream createCompressorInputStream(final String name, fina
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ZSTANDARD.equalsIgnoreCase(name)) {
|
if (ZSTANDARD.equalsIgnoreCase(name)) {
|
||||||
@ -44,7 +64,16 @@ index ab178a9..3817704 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (LZMA.equalsIgnoreCase(name)) {
|
if (LZMA.equalsIgnoreCase(name)) {
|
||||||
@@ -714,7 +704,7 @@ public class CompressorStreamFactory implements CompressorStreamProvider {
|
@@ -614,7 +600,7 @@ public CompressorInputStream createCompressorInputStream(final String name, fina
|
||||||
|
* Creates a compressor output stream from a compressor name and an output stream.
|
||||||
|
*
|
||||||
|
* @param name the compressor name, i.e. {@value #GZIP}, {@value #BZIP2}, {@value #XZ}, {@value #PACK200}, {@value #SNAPPY_FRAMED}, {@value #LZ4_BLOCK},
|
||||||
|
- * {@value #LZ4_FRAMED}, {@value #ZSTANDARD} or {@value #DEFLATE}
|
||||||
|
+ * {@value #LZ4_FRAMED} or {@value #DEFLATE}
|
||||||
|
* @param out the output stream
|
||||||
|
* @return the compressor output stream
|
||||||
|
* @throws CompressorException if the archiver name is not known
|
||||||
|
@@ -665,7 +651,7 @@ public CompressorOutputStream createCompressorOutputStream(final String name, fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ZSTANDARD.equalsIgnoreCase(name)) {
|
if (ZSTANDARD.equalsIgnoreCase(name)) {
|
||||||
@ -54,5 +83,5 @@ index ab178a9..3817704 100644
|
|||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
throw new CompressorException("Could not create CompressorOutputStream", e);
|
throw new CompressorException("Could not create CompressorOutputStream", e);
|
||||||
--
|
--
|
||||||
2.14.3
|
2.43.0
|
||||||
|
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
From 9937297a90b43a5e1238932eb8a07c44303056ed Mon Sep 17 00:00:00 2001
|
From 77d08229cd95cc948a19996faa8515e0d77d7930 Mon Sep 17 00:00:00 2001
|
||||||
From: Marian Koncek <mkoncek@redhat.com>
|
From: Marian Koncek <mkoncek@redhat.com>
|
||||||
Date: Fri, 6 Aug 2021 13:42:40 +0200
|
Date: Fri, 6 Aug 2021 13:42:40 +0200
|
||||||
Subject: [PATCH] Remove Pack200 compressor
|
Subject: [PATCH 3/3] Remove Pack200 compressor
|
||||||
|
|
||||||
---
|
---
|
||||||
.../compress/compressors/CompressorStreamFactory.java | 10 ++--------
|
.../compress/compressors/CompressorStreamFactory.java | 10 ++--------
|
||||||
1 file changed, 2 insertions(+), 8 deletions(-)
|
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
|
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 eee7c31..de7da23 100644
|
index 9ed40a3d7..565aa519e 100644
|
||||||
--- a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
|
--- a/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
|
||||||
+++ b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
|
+++ b/src/main/java/org/apache/commons/compress/compressors/CompressorStreamFactory.java
|
||||||
@@ -45,8 +45,6 @@ import org.apache.commons.compress.compressors.lz4.FramedLZ4CompressorOutputStre
|
@@ -44,8 +44,6 @@
|
||||||
import org.apache.commons.compress.compressors.lzma.LZMACompressorInputStream;
|
import org.apache.commons.compress.compressors.lzma.LZMACompressorInputStream;
|
||||||
import org.apache.commons.compress.compressors.lzma.LZMACompressorOutputStream;
|
import org.apache.commons.compress.compressors.lzma.LZMACompressorOutputStream;
|
||||||
import org.apache.commons.compress.compressors.lzma.LZMAUtils;
|
import org.apache.commons.compress.compressors.lzma.LZMAUtils;
|
||||||
@ -20,18 +20,18 @@ index eee7c31..de7da23 100644
|
|||||||
import org.apache.commons.compress.compressors.snappy.FramedSnappyCompressorInputStream;
|
import org.apache.commons.compress.compressors.snappy.FramedSnappyCompressorInputStream;
|
||||||
import org.apache.commons.compress.compressors.snappy.FramedSnappyCompressorOutputStream;
|
import org.apache.commons.compress.compressors.snappy.FramedSnappyCompressorOutputStream;
|
||||||
import org.apache.commons.compress.compressors.snappy.SnappyCompressorInputStream;
|
import org.apache.commons.compress.compressors.snappy.SnappyCompressorInputStream;
|
||||||
@@ -478,10 +476,6 @@ public class CompressorStreamFactory implements CompressorStreamProvider {
|
@@ -249,10 +247,6 @@ static String detect(final InputStream inputStream, final Set<String> compressor
|
||||||
return GZIP;
|
return GZIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
- if (Pack200CompressorInputStream.matches(signature, signatureLength)) {
|
- if (compressorNames.contains(PACK200) && Pack200CompressorInputStream.matches(signature, signatureLength)) {
|
||||||
- return PACK200;
|
- return PACK200;
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
if (FramedSnappyCompressorInputStream.matches(signature, signatureLength)) {
|
if (compressorNames.contains(SNAPPY_FRAMED) && FramedSnappyCompressorInputStream.matches(signature, signatureLength)) {
|
||||||
return SNAPPY_FRAMED;
|
return SNAPPY_FRAMED;
|
||||||
}
|
}
|
||||||
@@ -592,7 +586,7 @@ public class CompressorStreamFactory implements CompressorStreamProvider {
|
@@ -554,7 +548,7 @@ public CompressorInputStream createCompressorInputStream(final String name, fina
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PACK200.equalsIgnoreCase(name)) {
|
if (PACK200.equalsIgnoreCase(name)) {
|
||||||
@ -40,7 +40,7 @@ index eee7c31..de7da23 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (SNAPPY_RAW.equalsIgnoreCase(name)) {
|
if (SNAPPY_RAW.equalsIgnoreCase(name)) {
|
||||||
@@ -673,7 +667,7 @@ public class CompressorStreamFactory implements CompressorStreamProvider {
|
@@ -627,7 +621,7 @@ public CompressorOutputStream createCompressorOutputStream(final String name, fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PACK200.equalsIgnoreCase(name)) {
|
if (PACK200.equalsIgnoreCase(name)) {
|
||||||
@ -50,5 +50,5 @@ index eee7c31..de7da23 100644
|
|||||||
|
|
||||||
if (LZMA.equalsIgnoreCase(name)) {
|
if (LZMA.equalsIgnoreCase(name)) {
|
||||||
--
|
--
|
||||||
2.31.1
|
2.43.0
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<property file="build.properties"/>
|
<property file="build.properties"/>
|
||||||
|
|
||||||
<property name="build.name" value="commons-compress"/>
|
<property name="build.name" value="commons-compress"/>
|
||||||
<property name="build.version" value="1.21"/>
|
<property name="build.version" value="1.26.0"/>
|
||||||
<property name="build.finalName" value="${build.name}-${build.version}"/>
|
<property name="build.finalName" value="${build.name}-${build.version}"/>
|
||||||
<property name="build.dir" value="target"/>
|
<property name="build.dir" value="target"/>
|
||||||
<property name="build.javadocDir" value="${build.dir}/site/apidocs"/>
|
<property name="build.javadocDir" value="${build.dir}/site/apidocs"/>
|
||||||
@ -24,7 +24,8 @@
|
|||||||
<property name="commons.osgi.private" value=""/>
|
<property name="commons.osgi.private" value=""/>
|
||||||
<property name="commons.osgi.symbolicName" value="org.apache.commons.compress"/>
|
<property name="commons.osgi.symbolicName" value="org.apache.commons.compress"/>
|
||||||
|
|
||||||
<property name="compiler.source" value="1.8"/>
|
<property name="compiler.release" value="8"/>
|
||||||
|
<property name="compiler.source" value="1.${compiler.release}"/>
|
||||||
<property name="compiler.target" value="${compiler.source}"/>
|
<property name="compiler.target" value="${compiler.source}"/>
|
||||||
|
|
||||||
|
|
||||||
@ -60,6 +61,7 @@
|
|||||||
optimize="false"
|
optimize="false"
|
||||||
deprecation="true"
|
deprecation="true"
|
||||||
target="${compiler.target}"
|
target="${compiler.target}"
|
||||||
|
release="${compiler.release}"
|
||||||
verbose="false"
|
verbose="false"
|
||||||
fork="false"
|
fork="false"
|
||||||
source="${compiler.source}">
|
source="${compiler.source}">
|
||||||
|
@ -1,3 +1,269 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Feb 20 10:24:11 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
|
||||||
|
|
||||||
|
- Use %patch -P N instead of deprecated %patchN.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Feb 19 13:14:54 UTC 2024 - Fridrich Strba <fstrba@suse.com>
|
||||||
|
|
||||||
|
- Upgrade to 1.26
|
||||||
|
* Fixing several vulnerabilities
|
||||||
|
+ bsc#1220068, CVE-2024-26308
|
||||||
|
+ bsc#1220070, CVE-2024-25710
|
||||||
|
* New Features
|
||||||
|
+ Add and use ZipFile.builder(), ZipFile.Builder, and deprecate
|
||||||
|
constructors
|
||||||
|
+ Add and use SevenZFile.builder(), SevenZFile.Builder, and
|
||||||
|
deprecate constructors
|
||||||
|
+ Add and use ArchiveInputStream.getCharset()
|
||||||
|
+ Add and use ArchiveEntry.resolveIn(Path)
|
||||||
|
+ Add Maven property project.build.outputTimestamp for build
|
||||||
|
reproducibility
|
||||||
|
* Fixed Bugs
|
||||||
|
+ COMPRESS-632: Check for invalid PAX values in TarArchiveEntry
|
||||||
|
+ COMPRESS-632: Fix for zero size headers in ArjInputStream
|
||||||
|
+ COMPRESS-632: Fixes and tests for ArInputStream
|
||||||
|
+ COMPRESS-632: Fixes for dump file parsing
|
||||||
|
+ COMPRESS-632: Improve CPIO exception detection and handling
|
||||||
|
+ Deprecate SkipShieldingInputStream without replacement (no
|
||||||
|
longer used)
|
||||||
|
+ Reuse commons-codec, don't duplicate class PureJavaCrc32C
|
||||||
|
(removed package-private class)
|
||||||
|
+ Reuse commons-codec, don't duplicate class XXHash32
|
||||||
|
(deprecated class)
|
||||||
|
+ Reuse commons-io, don't duplicate class Charsets (deprecated
|
||||||
|
class)
|
||||||
|
+ Reuse commons-io, don't duplicate class IOUtils (deprecated
|
||||||
|
methods)
|
||||||
|
+ Reuse commons-io, don't duplicate class BoundedInputStream
|
||||||
|
(deprecated class)
|
||||||
|
+ Reuse commons-io, don't duplicate class FileTimes (deprecated
|
||||||
|
TimeUtils methods)
|
||||||
|
+ Reuse Arrays.equals(byte[], byte[]) and deprecate
|
||||||
|
ArchiveUtils.isEqual(byte[], byte[])
|
||||||
|
+ Add a null-check for the class loader of OsgiUtils
|
||||||
|
+ Add a null-check in Pack200.newInstance(String, String)
|
||||||
|
+ Deprecate ChecksumCalculatingInputStream in favor of
|
||||||
|
java.util.zip.CheckedInputStream
|
||||||
|
+ Deprecate CRC32VerifyingInputStream
|
||||||
|
.CRC32VerifyingInputStream(InputStream, long, int)
|
||||||
|
+ COMPRESS-655: FramedSnappyCompressorOutputStream produces
|
||||||
|
incorrect output when writing a large buffer
|
||||||
|
+ COMPRESS-657: Fix TAR directory entries being misinterpreted
|
||||||
|
as files
|
||||||
|
+ Deprecate unused method FileNameUtils.getBaseName(String)
|
||||||
|
+ Deprecate unused method FileNameUtils.getExtension(String)
|
||||||
|
+ ArchiveInputStream.BoundedInputStream.read() incorrectly adds
|
||||||
|
1 for EOF to the bytes read count
|
||||||
|
+ Deprecate IOUtils.read(File, byte[])
|
||||||
|
+ Deprecate IOUtils.copyRange(InputStream, long, OutputStream,
|
||||||
|
int)
|
||||||
|
+ COMPRESS-653: ZipArchiveOutputStream multi archive updates
|
||||||
|
metadata in incorrect file
|
||||||
|
+ Deprecate ByteUtils.InputStreamByteSupplier
|
||||||
|
+ Deprecate ByteUtils.fromLittleEndian(InputStream, int)
|
||||||
|
+ Deprecate ByteUtils.toLittleEndian(DataOutput, long, int)
|
||||||
|
+ Reduce duplication by having ArchiveInputStream extend
|
||||||
|
FilterInputStream
|
||||||
|
+ Support preamble garbage in ZipArchiveInputStream
|
||||||
|
+ COMPRESS-658: Fix formatting the lowest expressable DOS time
|
||||||
|
+ Drop reflection from ExtraFieldUtils static initialization
|
||||||
|
+ Preserve exception causation in
|
||||||
|
ExtraFieldUtils.register(Class)
|
||||||
|
- Upgrade to 1.25.0
|
||||||
|
* New features:
|
||||||
|
+ Add GzipParameters.getFileName() and deprecate getFilename()
|
||||||
|
+ Add GzipParameters.setFileName(String) and deprecate
|
||||||
|
setFilename(String)
|
||||||
|
+ Add FileNameUtil.getCompressedFileName(String) and deprecate
|
||||||
|
getCompressedFilename(String)
|
||||||
|
+ Add FileNameUtil.getUncompressedFileName(String) and deprecate
|
||||||
|
getUncompressedFilename(String)
|
||||||
|
+ Add FileNameUtil.isCompressedFileName(String) and deprecate
|
||||||
|
isCompressedFilename(String)
|
||||||
|
+ Add BZip2Utils.getCompressedFileName(String) and deprecate
|
||||||
|
getCompressedFilename(String)
|
||||||
|
+ Add BZip2Utils.getUncompressedFileName(String) and deprecate
|
||||||
|
getUncompressedFilename(String)
|
||||||
|
+ Add BZip2Utils.isCompressedFileName(String) and deprecate
|
||||||
|
isCompressedFilename(String)
|
||||||
|
+ Add LZMAUtils.getCompressedFileName(String) and deprecate
|
||||||
|
getCompressedFilename(String)
|
||||||
|
+ Add LZMAUtils.getUncompressedFileName(String) and deprecate
|
||||||
|
getUncompressedFilename(String)
|
||||||
|
+ Add LZMAUtils.isCompressedFileName(String) and deprecate
|
||||||
|
isCompressedFilename(String)
|
||||||
|
+ Add XYUtils.getCompressedFileName(String) and deprecate
|
||||||
|
getCompressedFilename(String)
|
||||||
|
+ Add XYUtils.getUncompressedFileName(String) and deprecate
|
||||||
|
getUncompressedFilename(String)
|
||||||
|
+ Add XYUtils.isCompressedFileName(String) and deprecate
|
||||||
|
isCompressedFilename(String)
|
||||||
|
+ Add GzipUtils.getCompressedFileName(String) and deprecate
|
||||||
|
getCompressedFilename(String)
|
||||||
|
+ Add GzipUtils.getUncompressedFileName(String) and deprecate
|
||||||
|
getUncompressedFilename(String)
|
||||||
|
+ Add GzipUtils.isCompressedFileName(String) and deprecate
|
||||||
|
isCompressedFilename(String)
|
||||||
|
+ Add SevenZOutputFile.putArchiveEntry(SevenZArchiveEntry) and
|
||||||
|
deprecate putArchiveEntry(ArchiveEntry)
|
||||||
|
+ Add generics to ChangeSet and ChangeSetPerformer
|
||||||
|
+ Add generics to ArchiveStreamProvider and friends
|
||||||
|
+ Add a generic type parameter to ArchiveOutputStream and avoid
|
||||||
|
unchecked/unconfirmed type casts in subclasses
|
||||||
|
+ Add a generic type parameter to ArchiveInputStream and
|
||||||
|
deprecate redundant get methods in subclasses
|
||||||
|
+ COMPRESS-648: Add ability to restrict autodetection in
|
||||||
|
CompressorStreamFactory
|
||||||
|
* Fixed Bugs:
|
||||||
|
+ Precompile regular expression in
|
||||||
|
ArArchiveInputStream.isBSDLongName(String)
|
||||||
|
+ Precompile regular expression in
|
||||||
|
ArArchiveInputStream.isGNULongName(String)
|
||||||
|
+ Precompile regular expression in
|
||||||
|
TarArchiveEntry.parseInstantFromDecimalSeconds(String)
|
||||||
|
+ Precompile regular expression in
|
||||||
|
ChangeSet.addDeletion(Change)
|
||||||
|
+ COMPRESS-649: Improve performance in
|
||||||
|
BlockLZ4CompressorOutputStream
|
||||||
|
+ Null-guard Lister.main(String[]) for programmatic invocation
|
||||||
|
+ NPE in pack200.NewAttributeBands.Reference
|
||||||
|
.addAttributeToBand(NewAttribute, InputStream)
|
||||||
|
+ Incorrect lazy initialization and update of static field in
|
||||||
|
pack200.CodecEncoding.getSpecifier(Codec, Codec)
|
||||||
|
+ Incorrect string comparison in unpack200.AttributeLayout
|
||||||
|
.numBackwardsCallables()
|
||||||
|
+ Inefficient use of keySet iterator instead of entrySet
|
||||||
|
iterator in pack200.PackingOptions
|
||||||
|
.addOrUpdateAttributeActions(List, Map, int)
|
||||||
|
+ Package private class pack200.IcBands.IcTuple should be a
|
||||||
|
static inner class
|
||||||
|
+ Private class ZipFile.BoundedFileChannelInputStream should be
|
||||||
|
a static inner class
|
||||||
|
+ Refactor internal SevenZ AES256SHA256Decoder InputStream into
|
||||||
|
a named static inner class
|
||||||
|
+ Refactor internal SevenZ AES256SHA256Decoder OutputStream into
|
||||||
|
a named static inner class
|
||||||
|
+ Use the root Locale for string conversion of command line
|
||||||
|
options in org.apache.commons.compress.archivers.sevenz.CLI
|
||||||
|
+ Calling PackingUtils.config(PackingOptions) with null now
|
||||||
|
closes the internal FileHandler
|
||||||
|
+ COMPRESS-650: LZ4 compressor throws IndexOutOfBoundsException
|
||||||
|
+ COMPRESS-632: LZWInputStream.initializeTables(int) should
|
||||||
|
throw IllegalArgumentException instead of
|
||||||
|
ArrayIndexOutOfBoundsException
|
||||||
|
+ COMPRESS-647: Throw IOException instead of
|
||||||
|
ArrayIndexOutOfBoundsException when reading Zip with data
|
||||||
|
descriptor entries
|
||||||
|
- Update to 1.24.0
|
||||||
|
* New features:
|
||||||
|
+ Make ZipArchiveEntry.getLocalHeaderOffset() public
|
||||||
|
* Fixed Bugs:
|
||||||
|
+ Use try-with-resources in ArchiveStreamFactory
|
||||||
|
+ Javadoc and code comments: Sanitize grammar issues and typos
|
||||||
|
+ Remove redundant (null) initializations
|
||||||
|
+ [StepSecurity] ci: Harden GitHub Actions
|
||||||
|
- Update to 1.23.0
|
||||||
|
* New features:
|
||||||
|
+ COMPRESS-614: Use FileTime for time fields in
|
||||||
|
SevenZipArchiveEntry
|
||||||
|
+ COMPRESS-621: Fix calculation the offset of the first ZIP
|
||||||
|
central directory entry
|
||||||
|
+ COMPRESS-633:Add encryption support for SevenZ
|
||||||
|
+ COMPRESS-613: Support for extra time data in Zip archives
|
||||||
|
+ COMPRESS-621: Add org.apache.commons.compress.archivers.zip
|
||||||
|
.DefaultBackingStoreSupplier to write to a custom folder
|
||||||
|
instead of the default temporary folder.
|
||||||
|
+ COMPRESS-600: Add capability to configure Deflater strategy
|
||||||
|
in GzipCompressorOutputStream:
|
||||||
|
GzipParameters.setDeflateStrategy(int).
|
||||||
|
* Fixed Bugs:
|
||||||
|
+ Implicit narrowing conversion in compound assignment
|
||||||
|
+ Avoid NPE in FileNameUtils.getBaseName(Path) for paths with
|
||||||
|
zero elements like root paths
|
||||||
|
+ Avoid NPE in FileNameUtils.getExtension(Path) for paths with
|
||||||
|
zero elements like root paths
|
||||||
|
+ LZMA2Decoder.decode() looses original exception
|
||||||
|
+ Extract conditions and avoid duplicate code.
|
||||||
|
+ Remove duplicate conditions. Use switch instead.
|
||||||
|
+ Replace JUnit 3 and 4 with JUnit 5
|
||||||
|
+ Make 'ZipFile.offsetComparator' static
|
||||||
|
+ COMPRESS-638: The GzipCompressorOutputStream#writeHeader()
|
||||||
|
uses ISO_8859_1 to write the file name and comment. If the
|
||||||
|
strings contains non-ISO_8859_1 characters, unknown characters
|
||||||
|
are displayed after decompression. Use percent encoding for
|
||||||
|
non ISO_8859_1 characters.
|
||||||
|
+ Port some code from IO to NIO APIs
|
||||||
|
+ pack200: Fix FileBands misusing InputStream#read(byte[])
|
||||||
|
+ COMPRESS-641: Add TarArchiveEntry.getLinkFlag()
|
||||||
|
+ COMPRESS-642: Integer overflow ArithmeticException in
|
||||||
|
TarArchiveOutputStream
|
||||||
|
+ COMPRESS-642: org.apache.commons.compress.archivers.zip
|
||||||
|
.ZipFile.finalize() should not write to std err.
|
||||||
|
* Removed:
|
||||||
|
+ Remove BZip2CompressorOutputStream.finalize() which only wrote
|
||||||
|
to std err
|
||||||
|
- Update to 1.22
|
||||||
|
* New features:
|
||||||
|
+ COMPRESS-602: Migrate zip package to use NIO
|
||||||
|
+ Add APK file extension constants: ArchiveStreamFactory.APK,
|
||||||
|
APKM, APKS, XAPK
|
||||||
|
+ ArchiveStreamFactory.createArchiveInputStream(String,
|
||||||
|
InputStream, String) supports the "APK" format (it's a JAR)
|
||||||
|
+ Expander example now has NIO Path versions of IO File APIs
|
||||||
|
+ COMPRESS-612: Improve TAR support for file times
|
||||||
|
+ Add SevenZArchiveEntry.setContentMethods(SevenZMethodConfiguration...)
|
||||||
|
* Fixed Bugs:
|
||||||
|
+ Fix some compiler warnings in pack200 packages
|
||||||
|
+ Close File input stream after unpacking in
|
||||||
|
Pack200UnpackerAdapter.unpack(File, JarOutputStream)
|
||||||
|
+ Pack200UnpackerAdapter.unpack(InputStream, JarOutputStream)
|
||||||
|
should not close its given input stream
|
||||||
|
+ COMPRESS-596: Fix minor problem in examples.
|
||||||
|
+ COMPRESS-584: Add a limit to the copy buffer in
|
||||||
|
IOUtils.readRange() to avoid reading more from a channel than
|
||||||
|
asked for
|
||||||
|
+ Documentation nits
|
||||||
|
+ Replace wrapper Collections.sort is with an instance method
|
||||||
|
directly
|
||||||
|
+ Replace manual comparisons with Comparator.comparingInt()
|
||||||
|
+ Replace manual copy of array contents with System.arraycopy()
|
||||||
|
+ Fix thread safety issues when encoding 7z password
|
||||||
|
+ bzip2: calculate median-of-3 on unsigned values
|
||||||
|
+ Use Math.min and Math.max calculations.
|
||||||
|
+ COMPRESS-603: Expander should be able to work if an entry's
|
||||||
|
name is "./".
|
||||||
|
+ COMPRESS-604: Ensure compatibility with Java 8
|
||||||
|
+ Use StringBuilder instead of StringBuffer.
|
||||||
|
+ Inline variable. Remove redundant local variable.
|
||||||
|
+ Use compare method
|
||||||
|
+ Remove Unnecessary interface modifiers
|
||||||
|
+ Avoid use C-style array declaration.
|
||||||
|
+ ChecksumVerifyingInputStream.read() does not always validate
|
||||||
|
checksum at end-of-stream
|
||||||
|
+ Fix TarFileTest
|
||||||
|
+ COMPRESS-625: Update Wikipedia link in TarUtils.java:627.
|
||||||
|
+ COMPRESS-626: OutOfMemoryError on malformed pack200 input
|
||||||
|
(attributes).
|
||||||
|
+ COMPRESS-628: OutOfMemoryError on malformed pack200 input
|
||||||
|
(org.apache.commons.compress.harmony.pack200.NewAttributeBands
|
||||||
|
.readNextUnionCase).
|
||||||
|
+ COMPRESS-628: OutOfMemoryError on malformed unpack200 input
|
||||||
|
(org.apache.commons.compress.harmony.unpack200
|
||||||
|
.NewAttributeBands.readNextUnionCase).
|
||||||
|
+ Some input streams are not closed in org.apache.commons
|
||||||
|
.compress.harmony.pack200.PackingUtils
|
||||||
|
+ COMPRESS-627: Pack200 causes a 'archive.3E' error if it's not
|
||||||
|
in the system class loader.
|
||||||
|
- Modified patches:
|
||||||
|
* 0001-Remove-Brotli-compressor.patch
|
||||||
|
* 0002-Remove-ZSTD-compressor.patch
|
||||||
|
* 0003-Remove-Pack200-compressor.patch
|
||||||
|
+ rediff to changed context
|
||||||
|
- Removed patch:
|
||||||
|
* fix_java_8_compatibility.patch
|
||||||
|
+ not needed, since we handle the compatibility differently
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Mar 21 08:57:33 UTC 2022 - Fridrich Strba <fstrba@suse.com>
|
Mon Mar 21 08:57:33 UTC 2022 - Fridrich Strba <fstrba@suse.com>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file
|
# spec file for package apache-commons-compress
|
||||||
#
|
#
|
||||||
# Copyright (c) 2022 SUSE LLC
|
# Copyright (c) 2024 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -19,23 +19,23 @@
|
|||||||
%global base_name compress
|
%global base_name compress
|
||||||
%global short_name commons-%{base_name}
|
%global short_name commons-%{base_name}
|
||||||
Name: apache-%{short_name}
|
Name: apache-%{short_name}
|
||||||
Version: 1.21
|
Version: 1.26.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Java API for working with compressed files and archivers
|
Summary: Java API for working with compressed files and archivers
|
||||||
License: Apache-2.0
|
License: Apache-2.0
|
||||||
Group: Development/Libraries/Java
|
Group: Development/Libraries/Java
|
||||||
URL: https://commons.apache.org/proper/commons-compress/
|
URL: https://commons.apache.org/proper/commons-compress/
|
||||||
Source0: http://archive.apache.org/dist/commons/compress/source/%{short_name}-%{version}-src.tar.gz
|
Source0: https://archive.apache.org/dist/commons/compress/source/%{short_name}-%{version}-src.tar.gz
|
||||||
Source1: http://archive.apache.org/dist/commons/compress/source/%{short_name}-%{version}-src.tar.gz.asc
|
Source1: %{name}-build.xml
|
||||||
Source2: %{name}-build.xml
|
|
||||||
Patch0: 0001-Remove-Brotli-compressor.patch
|
Patch0: 0001-Remove-Brotli-compressor.patch
|
||||||
Patch1: 0002-Remove-ZSTD-compressor.patch
|
Patch1: 0002-Remove-ZSTD-compressor.patch
|
||||||
Patch2: 0003-Remove-Pack200-compressor.patch
|
Patch2: 0003-Remove-Pack200-compressor.patch
|
||||||
Patch3: fix_java_8_compatibility.patch
|
|
||||||
BuildRequires: ant
|
BuildRequires: ant
|
||||||
|
BuildRequires: commons-codec
|
||||||
|
BuildRequires: commons-io >= 2.14
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: java-devel >= 1.8
|
BuildRequires: java-devel >= 1.8
|
||||||
BuildRequires: javapackages-local
|
BuildRequires: javapackages-local >= 6
|
||||||
BuildRequires: xz-java
|
BuildRequires: xz-java
|
||||||
Provides: %{short_name} = %{version}-%{release}
|
Provides: %{short_name} = %{version}-%{release}
|
||||||
Obsoletes: %{short_name} < %{version}-%{release}
|
Obsoletes: %{short_name} < %{version}-%{release}
|
||||||
@ -58,43 +58,34 @@ This package provides %{summary}.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{short_name}-%{version}-src
|
%setup -q -n %{short_name}-%{version}-src
|
||||||
cp %{SOURCE2} build.xml
|
cp %{SOURCE1} build.xml
|
||||||
|
|
||||||
# Unavailable Google Brotli library (org.brotli.dec)
|
# Unavailable Google Brotli library (org.brotli.dec)
|
||||||
%patch0 -p1
|
%patch -P 0 -p1
|
||||||
%pom_remove_dep org.brotli:dec
|
%pom_remove_dep org.brotli:dec
|
||||||
rm -r src/{main,test}/java/org/apache/commons/compress/compressors/brotli
|
rm -r src/{main,test}/java/org/apache/commons/compress/compressors/brotli
|
||||||
|
|
||||||
# Unavailable ZSTD JNI library
|
# Unavailable ZSTD JNI library
|
||||||
%patch1 -p1
|
%patch -P 1 -p1
|
||||||
%pom_remove_dep :zstd-jni
|
%pom_remove_dep :zstd-jni
|
||||||
rm -r src/{main,test}/java/org/apache/commons/compress/compressors/zstandard
|
rm -r src/{main,test}/java/org/apache/commons/compress/compressors/zstandard
|
||||||
rm src/test/java/org/apache/commons/compress/compressors/DetectCompressorTestCase.java
|
|
||||||
|
|
||||||
# Remove support for pack200 which depends on ancient asm:asm:3.2
|
# Remove support for pack200 which depends on ancient asm:asm:3.2
|
||||||
%patch2 -p1
|
%patch -P 2 -p1
|
||||||
%pom_remove_dep asm:asm
|
|
||||||
rm -r src/{main,test}/java/org/apache/commons/compress/harmony
|
rm -r src/{main,test}/java/org/apache/commons/compress/harmony
|
||||||
rm -r src/main/java/org/apache/commons/compress/compressors/pack200
|
rm -r src/main/java/org/apache/commons/compress/compressors/pack200
|
||||||
rm src/main/java/org/apache/commons/compress/java/util/jar/Pack200.java
|
rm src/main/java/org/apache/commons/compress/java/util/jar/Pack200.java
|
||||||
rm src/test/java/org/apache/commons/compress/compressors/Pack200TestCase.java
|
|
||||||
rm -r src/test/java/org/apache/commons/compress/compressors/pack200
|
rm -r src/test/java/org/apache/commons/compress/compressors/pack200
|
||||||
rm src/test/java/org/apache/commons/compress/java/util/jar/Pack200Test.java
|
rm src/test/java/org/apache/commons/compress/java/util/jar/Pack200Test.java
|
||||||
|
|
||||||
# Restore Java 8 compatibility
|
|
||||||
%patch3 -p1
|
|
||||||
|
|
||||||
# NPE with jdk10
|
# NPE with jdk10
|
||||||
%pom_remove_plugin :maven-javadoc-plugin
|
%pom_remove_plugin :maven-javadoc-plugin
|
||||||
|
|
||||||
%pom_xpath_remove "pom:profiles/pom:profile[pom:id[text()='java9+']]"
|
%pom_xpath_remove "pom:profiles/pom:profile[pom:id[text()='java9+']]"
|
||||||
|
|
||||||
%pom_remove_parent .
|
|
||||||
%pom_xpath_inject "pom:project" "<groupId>org.apache.commons</groupId>" .
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
mkdir -p lib
|
mkdir -p lib
|
||||||
build-jar-repository -s lib xz-java
|
build-jar-repository -s lib xz-java commons-io commons-codec
|
||||||
%{ant} package javadoc
|
%{ant} package javadoc
|
||||||
|
|
||||||
%install
|
%install
|
||||||
@ -104,7 +95,7 @@ install -pm 0644 target/%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{s
|
|||||||
ln -sf %{short_name}.jar %{buildroot}%{_javadir}/%{name}.jar
|
ln -sf %{short_name}.jar %{buildroot}%{_javadir}/%{name}.jar
|
||||||
# pom
|
# pom
|
||||||
install -dm 0755 %{buildroot}%{_mavenpomdir}
|
install -dm 0755 %{buildroot}%{_mavenpomdir}
|
||||||
install -pm 0644 pom.xml %{buildroot}%{_mavenpomdir}/%{short_name}.pom
|
%{mvn_install_pom} pom.xml %{buildroot}%{_mavenpomdir}/%{short_name}.pom
|
||||||
%add_maven_depmap %{short_name}.pom %{short_name}.jar -a commons:commons-compress,commons-compress:commons-compress
|
%add_maven_depmap %{short_name}.pom %{short_name}.jar -a commons:commons-compress,commons-compress:commons-compress
|
||||||
# javadoc
|
# javadoc
|
||||||
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}
|
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:3ecb1feb62e5307d0fc865dd0b5a80206758aec1d160d297e5c153cfba5977e6
|
|
||||||
size 15165800
|
|
@ -1,7 +0,0 @@
|
|||||||
-----BEGIN PGP SIGNATURE-----
|
|
||||||
|
|
||||||
iHEEABEKADEWIQTOgHWiUVR77iSbwVGiEVrhX2uLcgUCYOiAPBMcYm9kZXdpZ0Bh
|
|
||||||
cGFjaGUub3JnAAoJEKIRWuFfa4tyyNwAn1RAMciW7Os/lbwCiQ/RJ64GL+LSAKDB
|
|
||||||
7ZWg3nXsSSAnuN7K/3doWvLkLQ==
|
|
||||||
=iHWA
|
|
||||||
-----END PGP SIGNATURE-----
|
|
BIN
commons-compress-1.26.0-src.tar.gz
(Stored with Git LFS)
Normal file
BIN
commons-compress-1.26.0-src.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -1,441 +0,0 @@
|
|||||||
--- commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/sevenz/BoundedSeekableByteChannelInputStream.java 2020-01-22 16:10:15.000000000 +0100
|
|
||||||
+++ commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/sevenz/BoundedSeekableByteChannelInputStream.java 2021-07-19 16:32:46.529020782 +0200
|
|
||||||
@@ -19,6 +19,7 @@
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
+import java.nio.Buffer;
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.nio.channels.SeekableByteChannel;
|
|
||||||
|
|
||||||
@@ -83,7 +84,7 @@
|
|
||||||
} else {
|
|
||||||
buf = ByteBuffer.allocate(bytesToRead);
|
|
||||||
bytesRead = channel.read(buf);
|
|
||||||
- buf.flip();
|
|
||||||
+ ((Buffer)buf).flip();
|
|
||||||
}
|
|
||||||
if (bytesRead >= 0) {
|
|
||||||
buf.get(b, off, bytesRead);
|
|
||||||
@@ -93,9 +94,9 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
private int read(final int len) throws IOException {
|
|
||||||
- buffer.rewind().limit(len);
|
|
||||||
+ ((Buffer)buffer).rewind().limit(len);
|
|
||||||
final int read = channel.read(buffer);
|
|
||||||
- buffer.flip();
|
|
||||||
+ ((Buffer)buffer).flip();
|
|
||||||
return read;
|
|
||||||
}
|
|
||||||
|
|
||||||
--- commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java 2020-01-22 16:10:15.000000000 +0100
|
|
||||||
+++ commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java 2021-07-19 16:20:02.675782684 +0200
|
|
||||||
@@ -26,6 +26,7 @@
|
|
||||||
import java.io.FilterInputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
+import java.nio.Buffer;
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.nio.ByteOrder;
|
|
||||||
import java.nio.CharBuffer;
|
|
||||||
@@ -499,7 +500,7 @@
|
|
||||||
while (pos > minPos) {
|
|
||||||
pos--;
|
|
||||||
channel.position(pos);
|
|
||||||
- nidBuf.rewind();
|
|
||||||
+ ((Buffer)nidBuf).rewind();
|
|
||||||
if (channel.read(nidBuf) < 1) {
|
|
||||||
throw new EOFException();
|
|
||||||
}
|
|
||||||
@@ -2016,9 +2017,9 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
private void readFully(final ByteBuffer buf) throws IOException {
|
|
||||||
- buf.rewind();
|
|
||||||
+ ((Buffer)buf).rewind();
|
|
||||||
IOUtils.readFully(channel, buf);
|
|
||||||
- buf.flip();
|
|
||||||
+ ((Buffer)buf).flip();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
--- commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFile.java 2020-01-22 16:10:15.000000000 +0100
|
|
||||||
+++ commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFile.java 2021-07-19 16:14:03.565317437 +0200
|
|
||||||
@@ -26,6 +26,7 @@
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
+import java.nio.Buffer;
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.nio.ByteOrder;
|
|
||||||
import java.nio.channels.SeekableByteChannel;
|
|
||||||
@@ -341,7 +342,7 @@
|
|
||||||
crc32.reset();
|
|
||||||
crc32.update(bb.array(), SevenZFile.sevenZSignature.length + 6, 20);
|
|
||||||
bb.putInt(SevenZFile.sevenZSignature.length + 2, (int) crc32.getValue());
|
|
||||||
- bb.flip();
|
|
||||||
+ ((Buffer)bb).flip();
|
|
||||||
channel.write(bb);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -826,7 +827,7 @@
|
|
||||||
private final ByteBuffer buffer = ByteBuffer.allocate(BUF_SIZE);
|
|
||||||
@Override
|
|
||||||
public void write(final int b) throws IOException {
|
|
||||||
- buffer.clear();
|
|
||||||
+ ((Buffer)buffer).clear();
|
|
||||||
buffer.put((byte) b).flip();
|
|
||||||
channel.write(buffer);
|
|
||||||
compressedCrc32.update(b);
|
|
||||||
@@ -844,7 +845,7 @@
|
|
||||||
if (len > BUF_SIZE) {
|
|
||||||
channel.write(ByteBuffer.wrap(b, off, len));
|
|
||||||
} else {
|
|
||||||
- buffer.clear();
|
|
||||||
+ ((Buffer)buffer).clear();
|
|
||||||
buffer.put(b, off, len).flip();
|
|
||||||
channel.write(buffer);
|
|
||||||
}
|
|
||||||
--- commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/zip/NioZipEncoding.java 2020-01-22 16:10:15.000000000 +0100
|
|
||||||
+++ commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/zip/NioZipEncoding.java 2021-07-19 16:14:03.565317437 +0200
|
|
||||||
@@ -20,6 +20,7 @@
|
|
||||||
package org.apache.commons.compress.archivers.zip;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
+import java.nio.Buffer;
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.nio.CharBuffer;
|
|
||||||
import java.nio.charset.Charset;
|
|
||||||
@@ -121,8 +122,8 @@
|
|
||||||
enc.encode(cb, out, true);
|
|
||||||
// may have caused underflow, but that's been ignored traditionally
|
|
||||||
|
|
||||||
- out.limit(out.position());
|
|
||||||
- out.rewind();
|
|
||||||
+ ((Buffer)out).limit(out.position());
|
|
||||||
+ ((Buffer)out).rewind();
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
--- commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java 2020-01-22 16:10:15.000000000 +0100
|
|
||||||
+++ commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java 2021-07-19 16:14:03.565317437 +0200
|
|
||||||
@@ -25,6 +25,7 @@
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.PushbackInputStream;
|
|
||||||
import java.math.BigInteger;
|
|
||||||
+import java.nio.Buffer;
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.zip.CRC32;
|
|
||||||
@@ -256,7 +257,7 @@
|
|
||||||
allowStoredEntriesWithDataDescriptor;
|
|
||||||
this.skipSplitSig = skipSplitSig;
|
|
||||||
// haven't read anything so far
|
|
||||||
- buf.limit(0);
|
|
||||||
+ ((Buffer)buf).limit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ZipArchiveEntry getNextZipEntry() throws IOException {
|
|
||||||
@@ -596,13 +597,13 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
if (buf.position() >= buf.limit()) {
|
|
||||||
- buf.position(0);
|
|
||||||
+ ((Buffer)buf).position(0);
|
|
||||||
final int l = in.read(buf.array());
|
|
||||||
if (l == -1) {
|
|
||||||
- buf.limit(0);
|
|
||||||
+ ((Buffer)buf).limit(0);
|
|
||||||
throw new IOException("Truncated ZIP file");
|
|
||||||
}
|
|
||||||
- buf.limit(l);
|
|
||||||
+ ((Buffer)buf).limit(l);
|
|
||||||
|
|
||||||
count(l);
|
|
||||||
current.bytesReadFromStream += l;
|
|
||||||
@@ -795,7 +796,7 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
inf.reset();
|
|
||||||
- buf.clear().flip();
|
|
||||||
+ ((Buffer)buf).clear().flip();
|
|
||||||
current = null;
|
|
||||||
lastStoredEntry = null;
|
|
||||||
}
|
|
||||||
@@ -860,7 +861,7 @@
|
|
||||||
}
|
|
||||||
final int length = in.read(buf.array());
|
|
||||||
if (length > 0) {
|
|
||||||
- buf.limit(length);
|
|
||||||
+ ((Buffer)buf).limit(length);
|
|
||||||
count(buf.limit());
|
|
||||||
inf.setInput(buf.array(), 0, buf.limit());
|
|
||||||
}
|
|
||||||
--- commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/zip/ZipEncodingHelper.java 2020-01-22 16:10:15.000000000 +0100
|
|
||||||
+++ commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/zip/ZipEncodingHelper.java 2021-07-19 16:29:53.519835167 +0200
|
|
||||||
@@ -18,6 +18,7 @@
|
|
||||||
|
|
||||||
package org.apache.commons.compress.archivers.zip;
|
|
||||||
|
|
||||||
+import java.nio.Buffer;
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.nio.charset.Charset;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
@@ -85,8 +86,8 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
static ByteBuffer growBufferBy(final ByteBuffer buffer, final int increment) {
|
|
||||||
- buffer.limit(buffer.position());
|
|
||||||
- buffer.rewind();
|
|
||||||
+ ((Buffer)buffer).limit(buffer.position());
|
|
||||||
+ ((Buffer)buffer).rewind();
|
|
||||||
|
|
||||||
final ByteBuffer on = ByteBuffer.allocate(buffer.capacity() + increment);
|
|
||||||
|
|
||||||
--- commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java 2020-01-22 16:10:15.000000000 +0100
|
|
||||||
+++ commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java 2021-07-19 16:28:13.175147502 +0200
|
|
||||||
@@ -25,6 +25,7 @@
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.SequenceInputStream;
|
|
||||||
+import java.nio.Buffer;
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.nio.channels.FileChannel;
|
|
||||||
import java.nio.channels.SeekableByteChannel;
|
|
||||||
@@ -713,7 +714,7 @@
|
|
||||||
positionAtCentralDirectory();
|
|
||||||
centralDirectoryStartOffset = archive.position();
|
|
||||||
|
|
||||||
- wordBbuf.rewind();
|
|
||||||
+ ((Buffer)wordBbuf).rewind();
|
|
||||||
IOUtils.readFully(archive, wordBbuf);
|
|
||||||
long sig = ZipLong.getValue(wordBuf);
|
|
||||||
|
|
||||||
@@ -724,7 +725,7 @@
|
|
||||||
|
|
||||||
while (sig == CFH_SIG) {
|
|
||||||
readCentralDirectoryEntry(noUTF8Flag);
|
|
||||||
- wordBbuf.rewind();
|
|
||||||
+ ((Buffer)wordBbuf).rewind();
|
|
||||||
IOUtils.readFully(archive, wordBbuf);
|
|
||||||
sig = ZipLong.getValue(wordBuf);
|
|
||||||
}
|
|
||||||
@@ -743,7 +744,7 @@
|
|
||||||
private void
|
|
||||||
readCentralDirectoryEntry(final Map<ZipArchiveEntry, NameAndComment> noUTF8Flag)
|
|
||||||
throws IOException {
|
|
||||||
- cfhBbuf.rewind();
|
|
||||||
+ ((Buffer)cfhBbuf).rewind();
|
|
||||||
IOUtils.readFully(archive, cfhBbuf);
|
|
||||||
int off = 0;
|
|
||||||
final Entry ze = new Entry();
|
|
||||||
@@ -1100,7 +1101,7 @@
|
|
||||||
archive.position() > ZIP64_EOCDL_LENGTH;
|
|
||||||
if (searchedForZip64EOCD) {
|
|
||||||
archive.position(archive.position() - ZIP64_EOCDL_LENGTH);
|
|
||||||
- wordBbuf.rewind();
|
|
||||||
+ ((Buffer)wordBbuf).rewind();
|
|
||||||
IOUtils.readFully(archive, wordBbuf);
|
|
||||||
found = Arrays.equals(ZipArchiveOutputStream.ZIP64_EOCD_LOC_SIG,
|
|
||||||
wordBuf);
|
|
||||||
@@ -1128,11 +1129,11 @@
|
|
||||||
private void positionAtCentralDirectory64()
|
|
||||||
throws IOException {
|
|
||||||
if (isSplitZipArchive) {
|
|
||||||
- wordBbuf.rewind();
|
|
||||||
+ ((Buffer)wordBbuf).rewind();
|
|
||||||
IOUtils.readFully(archive, wordBbuf);
|
|
||||||
final long diskNumberOfEOCD = ZipLong.getValue(wordBuf);
|
|
||||||
|
|
||||||
- dwordBbuf.rewind();
|
|
||||||
+ ((Buffer)dwordBbuf).rewind();
|
|
||||||
IOUtils.readFully(archive, dwordBbuf);
|
|
||||||
final long relativeOffsetOfEOCD = ZipEightByteInteger.getLongValue(dwordBuf);
|
|
||||||
((ZipSplitReadOnlySeekableByteChannel) archive)
|
|
||||||
@@ -1140,12 +1141,12 @@
|
|
||||||
} else {
|
|
||||||
skipBytes(ZIP64_EOCDL_LOCATOR_OFFSET
|
|
||||||
- WORD /* signature has already been read */);
|
|
||||||
- dwordBbuf.rewind();
|
|
||||||
+ ((Buffer)dwordBbuf).rewind();
|
|
||||||
IOUtils.readFully(archive, dwordBbuf);
|
|
||||||
archive.position(ZipEightByteInteger.getLongValue(dwordBuf));
|
|
||||||
}
|
|
||||||
|
|
||||||
- wordBbuf.rewind();
|
|
||||||
+ ((Buffer)wordBbuf).rewind();
|
|
||||||
IOUtils.readFully(archive, wordBbuf);
|
|
||||||
if (!Arrays.equals(wordBuf, ZipArchiveOutputStream.ZIP64_EOCD_SIG)) {
|
|
||||||
throw new ZipException("Archive's ZIP64 end of central "
|
|
||||||
@@ -1155,13 +1156,13 @@
|
|
||||||
if (isSplitZipArchive) {
|
|
||||||
skipBytes(ZIP64_EOCD_CFD_DISK_OFFSET
|
|
||||||
- WORD /* signature has already been read */);
|
|
||||||
- wordBbuf.rewind();
|
|
||||||
+ ((Buffer)wordBbuf).rewind();
|
|
||||||
IOUtils.readFully(archive, wordBbuf);
|
|
||||||
centralDirectoryStartDiskNumber = ZipLong.getValue(wordBuf);
|
|
||||||
|
|
||||||
skipBytes(ZIP64_EOCD_CFD_LOCATOR_RELATIVE_OFFSET);
|
|
||||||
|
|
||||||
- dwordBbuf.rewind();
|
|
||||||
+ ((Buffer)dwordBbuf).rewind();
|
|
||||||
IOUtils.readFully(archive, dwordBbuf);
|
|
||||||
centralDirectoryStartRelativeOffset = ZipEightByteInteger.getLongValue(dwordBuf);
|
|
||||||
((ZipSplitReadOnlySeekableByteChannel) archive)
|
|
||||||
@@ -1169,7 +1170,7 @@
|
|
||||||
} else {
|
|
||||||
skipBytes(ZIP64_EOCD_CFD_LOCATOR_OFFSET
|
|
||||||
- WORD /* signature has already been read */);
|
|
||||||
- dwordBbuf.rewind();
|
|
||||||
+ ((Buffer)dwordBbuf).rewind();
|
|
||||||
IOUtils.readFully(archive, dwordBbuf);
|
|
||||||
centralDirectoryStartDiskNumber = 0;
|
|
||||||
centralDirectoryStartRelativeOffset = ZipEightByteInteger.getLongValue(dwordBuf);
|
|
||||||
@@ -1188,20 +1189,20 @@
|
|
||||||
throws IOException {
|
|
||||||
if (isSplitZipArchive) {
|
|
||||||
skipBytes(CFD_DISK_OFFSET);
|
|
||||||
- shortBbuf.rewind();
|
|
||||||
+ ((Buffer)shortBbuf).rewind();
|
|
||||||
IOUtils.readFully(archive, shortBbuf);
|
|
||||||
centralDirectoryStartDiskNumber = ZipShort.getValue(shortBuf);
|
|
||||||
|
|
||||||
skipBytes(CFD_LOCATOR_RELATIVE_OFFSET);
|
|
||||||
|
|
||||||
- wordBbuf.rewind();
|
|
||||||
+ ((Buffer)wordBbuf).rewind();
|
|
||||||
IOUtils.readFully(archive, wordBbuf);
|
|
||||||
centralDirectoryStartRelativeOffset = ZipLong.getValue(wordBuf);
|
|
||||||
((ZipSplitReadOnlySeekableByteChannel) archive)
|
|
||||||
.position(centralDirectoryStartDiskNumber, centralDirectoryStartRelativeOffset);
|
|
||||||
} else {
|
|
||||||
skipBytes(CFD_LOCATOR_OFFSET);
|
|
||||||
- wordBbuf.rewind();
|
|
||||||
+ ((Buffer)wordBbuf).rewind();
|
|
||||||
IOUtils.readFully(archive, wordBbuf);
|
|
||||||
centralDirectoryStartDiskNumber = 0;
|
|
||||||
centralDirectoryStartRelativeOffset = ZipLong.getValue(wordBuf);
|
|
||||||
@@ -1238,9 +1239,9 @@
|
|
||||||
for (; off >= stopSearching; off--) {
|
|
||||||
archive.position(off);
|
|
||||||
try {
|
|
||||||
- wordBbuf.rewind();
|
|
||||||
+ ((Buffer)wordBbuf).rewind();
|
|
||||||
IOUtils.readFully(archive, wordBbuf);
|
|
||||||
- wordBbuf.flip();
|
|
||||||
+ ((Buffer)wordBbuf).flip();
|
|
||||||
} catch (final EOFException ex) { // NOSONAR
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
@@ -1352,9 +1353,9 @@
|
|
||||||
} else {
|
|
||||||
archive.position(offset + LFH_OFFSET_FOR_FILENAME_LENGTH);
|
|
||||||
}
|
|
||||||
- wordBbuf.rewind();
|
|
||||||
+ ((Buffer)wordBbuf).rewind();
|
|
||||||
IOUtils.readFully(archive, wordBbuf);
|
|
||||||
- wordBbuf.flip();
|
|
||||||
+ ((Buffer)wordBbuf).flip();
|
|
||||||
wordBbuf.get(shortBuf);
|
|
||||||
final int fileNameLen = ZipShort.getValue(shortBuf);
|
|
||||||
wordBbuf.get(shortBuf);
|
|
||||||
@@ -1382,7 +1383,7 @@
|
|
||||||
*/
|
|
||||||
private boolean startsWithLocalFileHeader() throws IOException {
|
|
||||||
archive.position(0);
|
|
||||||
- wordBbuf.rewind();
|
|
||||||
+ ((Buffer)wordBbuf).rewind();
|
|
||||||
IOUtils.readFully(archive, wordBbuf);
|
|
||||||
return Arrays.equals(wordBuf, ZipArchiveOutputStream.LFH_SIG);
|
|
||||||
}
|
|
||||||
@@ -1418,7 +1419,7 @@
|
|
||||||
@Override
|
|
||||||
protected int read(final long pos, final ByteBuffer buf) throws IOException {
|
|
||||||
final int read = archive.read(buf, pos);
|
|
||||||
- buf.flip();
|
|
||||||
+ ((Buffer)buf).flip();
|
|
||||||
return read;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
--- commons-compress-1.21-src/src/main/java/org/apache/commons/compress/utils/FixedLengthBlockOutputStream.java 2020-01-22 16:10:15.000000000 +0100
|
|
||||||
+++ commons-compress-1.21-src/src/main/java/org/apache/commons/compress/utils/FixedLengthBlockOutputStream.java 2021-07-19 16:16:51.850472686 +0200
|
|
||||||
@@ -21,6 +21,7 @@
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
+import java.nio.Buffer;
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.nio.ByteOrder;
|
|
||||||
import java.nio.channels.ClosedChannelException;
|
|
||||||
@@ -88,7 +89,7 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
private void writeBlock() throws IOException {
|
|
||||||
- buffer.flip();
|
|
||||||
+ ((Buffer)buffer).flip();
|
|
||||||
final int i = out.write(buffer);
|
|
||||||
final boolean hasRemaining = buffer.hasRemaining();
|
|
||||||
if (i != blockSize || hasRemaining) {
|
|
||||||
@@ -97,7 +98,7 @@
|
|
||||||
blockSize, i);
|
|
||||||
throw new IOException(msg);
|
|
||||||
}
|
|
||||||
- buffer.clear();
|
|
||||||
+ ((Buffer)buffer).clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@@ -142,7 +143,7 @@
|
|
||||||
// fill up the reset of buffer and write the block.
|
|
||||||
if (buffer.position() != 0) {
|
|
||||||
final int n = buffer.remaining();
|
|
||||||
- src.limit(src.position() + n);
|
|
||||||
+ ((Buffer)src).limit(src.position() + n);
|
|
||||||
buffer.put(src);
|
|
||||||
writeBlock();
|
|
||||||
srcLeft -= n;
|
|
||||||
@@ -150,12 +151,12 @@
|
|
||||||
// whilst we have enough bytes in src for complete blocks,
|
|
||||||
// write them directly from src without copying them to buffer
|
|
||||||
while (srcLeft >= blockSize) {
|
|
||||||
- src.limit(src.position() + blockSize);
|
|
||||||
+ ((Buffer)src).limit(src.position() + blockSize);
|
|
||||||
out.write(src);
|
|
||||||
srcLeft -= blockSize;
|
|
||||||
}
|
|
||||||
// copy any remaining bytes into buffer
|
|
||||||
- src.limit(savedLimit);
|
|
||||||
+ ((Buffer)src).limit(savedLimit);
|
|
||||||
buffer.put(src);
|
|
||||||
}
|
|
||||||
return srcRemaining;
|
|
||||||
@@ -242,7 +243,7 @@
|
|
||||||
final int pos = buffer.position();
|
|
||||||
final int len = buffer.limit() - pos;
|
|
||||||
out.write(buffer.array(), buffer.arrayOffset() + pos, len);
|
|
||||||
- buffer.position(buffer.limit());
|
|
||||||
+ ((Buffer)buffer).position(buffer.limit());
|
|
||||||
return len;
|
|
||||||
} catch (final IOException e) {
|
|
||||||
try {
|
|
||||||
--- commons-compress-1.21-src/src/main/java/org/apache/commons/compress/utils/IOUtils.java 2020-01-22 16:10:15.000000000 +0100
|
|
||||||
+++ commons-compress-1.21-src/src/main/java/org/apache/commons/compress/utils/IOUtils.java 2021-07-19 17:09:11.659891748 +0200
|
|
||||||
@@ -25,6 +25,7 @@
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
+import java.nio.Buffer;
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.nio.channels.ReadableByteChannel;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
@@ -372,7 +373,7 @@
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
output.write(b.array(), 0, readNow);
|
|
||||||
- b.rewind();
|
|
||||||
+ ((Buffer)b).rewind();
|
|
||||||
read += readNow;
|
|
||||||
}
|
|
||||||
return output.toByteArray();
|
|
Loading…
x
Reference in New Issue
Block a user