This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git
The following commit(s) were added to refs/heads/master by this push:
new aae2eae28 Deprecate all but one TarArchiveInputStream constructor
aae2eae28 is described below
commit aae2eae281ba117e278f20ae42c5ce533485df24
Author: Gary D. Gregory <[email protected]>
AuthorDate: Tue Aug 19 08:26:47 2025 -0400
Deprecate all but one TarArchiveInputStream constructor
---
src/changes/changes.xml | 2 +-
.../compress/archivers/tar/TarArchiveInputStream.java | 16 +++++++++++++++-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index b54745184..02ebf3933 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -115,7 +115,7 @@ The <action> type attribute can be add,update,fix,remove.
<action type="add" dev="ggregory" due-to="Gary Gregory">Add
org.apache.commons.compress.compressors.snappy.SnappyCompressorInputStream.getUncompressedSize()
and deprecate getSize().</action>
<action type="add" dev="ggregory" due-to="Gary Gregory">Add
org.apache.commons.compress.archivers.ArchiveInputStream.ArchiveInputStream(InputStream,
Charset) as a public constructor, it was private.</action>
<action type="add" dev="ggregory" due-to="Gary Gregory">Add
org.apache.commons.compress.archivers.tar.TarArchiveInputStream.builder().</action>
- <action type="add" dev="ggregory" due-to="Gary Gregory">Add
org.apache.commons.compress.archivers.tar.TarArchiveInputStream.Builder.</action>
+ <action type="add" dev="ggregory" due-to="Gary Gregory">Add
org.apache.commons.compress.archivers.tar.TarArchiveInputStream.Builder and
deprecate all but one constructor.</action>
<!-- UPDATE -->
</release>
<release version="1.28.0" date="2025-07-26" description="This is a feature
and maintenance release. Java 8 or later is required.">
diff --git
a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
index 65d2fc71e..2ac85e398 100644
---
a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
+++
b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStream.java
@@ -233,13 +233,15 @@ public TarArchiveInputStream(final InputStream
inputStream) {
}
/**
- * Constructs a new instance.
+ * Constructs a new instance with default values.
*
* @param inputStream the input stream to use.
* @param lenient when set to true illegal values for group/userid,
mode, device numbers and timestamp will be ignored and the fields set to
* {@link TarArchiveEntry#UNKNOWN}. When set to false
such illegal fields cause an exception instead.
* @since 1.19
+ * @deprecated Use {@link #builder()} to configure and {@link
Builder#get() get()} a {@link Builder}.
*/
+ @Deprecated
public TarArchiveInputStream(final InputStream inputStream, final boolean
lenient) {
this(inputStream, TarConstants.DEFAULT_BLKSIZE,
TarConstants.DEFAULT_RCDSIZE, null, lenient);
}
@@ -249,7 +251,9 @@ public TarArchiveInputStream(final InputStream inputStream,
final boolean lenien
*
* @param inputStream the input stream to use.
* @param blockSize the block size to use.
+ * @deprecated Use {@link #builder()} to configure and {@link
Builder#get() get()} a {@link Builder}.
*/
+ @Deprecated
public TarArchiveInputStream(final InputStream inputStream, final int
blockSize) {
this(inputStream, blockSize, TarConstants.DEFAULT_RCDSIZE);
}
@@ -260,7 +264,9 @@ public TarArchiveInputStream(final InputStream inputStream,
final int blockSize)
* @param inputStream the input stream to use.
* @param blockSize the block size to use.
* @param recordSize the record size to use.
+ * @deprecated Use {@link #builder()} to configure and {@link
Builder#get() get()} a {@link Builder}.
*/
+ @Deprecated
public TarArchiveInputStream(final InputStream inputStream, final int
blockSize, final int recordSize) {
this(inputStream, blockSize, recordSize, null);
}
@@ -273,7 +279,9 @@ public TarArchiveInputStream(final InputStream inputStream,
final int blockSize,
* @param recordSize the record size to use.
* @param encoding name of the encoding to use for file names.
* @since 1.4
+ * @deprecated Use {@link #builder()} to configure and {@link
Builder#get() get()} a {@link Builder}.
*/
+ @Deprecated
public TarArchiveInputStream(final InputStream inputStream, final int
blockSize, final int recordSize, final String encoding) {
this(inputStream, blockSize, recordSize, encoding, false);
}
@@ -288,7 +296,9 @@ public TarArchiveInputStream(final InputStream inputStream,
final int blockSize,
* @param lenient when set to true illegal values for group/userid,
mode, device numbers and timestamp will be ignored and the fields set to
* {@link TarArchiveEntry#UNKNOWN}. When set to false
such illegal fields cause an exception instead.
* @since 1.19
+ * @deprecated Use {@link #builder()} to configure and {@link
Builder#get() get()} a {@link Builder}.
*/
+ @Deprecated
public TarArchiveInputStream(final InputStream inputStream, final int
blockSize, final int recordSize, final String encoding, final boolean lenient) {
super(inputStream, encoding);
this.zipEncoding = ZipEncodingHelper.getZipEncoding(encoding);
@@ -304,7 +314,9 @@ public TarArchiveInputStream(final InputStream inputStream,
final int blockSize,
* @param blockSize the block size to use.
* @param encoding name of the encoding to use for file names.
* @since 1.4
+ * @deprecated Use {@link #builder()} to configure and {@link
Builder#get() get()} a {@link Builder}.
*/
+ @Deprecated
public TarArchiveInputStream(final InputStream inputStream, final int
blockSize, final String encoding) {
this(inputStream, blockSize, TarConstants.DEFAULT_RCDSIZE, encoding);
}
@@ -315,7 +327,9 @@ public TarArchiveInputStream(final InputStream inputStream,
final int blockSize,
* @param inputStream the input stream to use.
* @param encoding name of the encoding to use for file names.
* @since 1.4
+ * @deprecated Use {@link #builder()} to configure and {@link
Builder#get() get()} a {@link Builder}.
*/
+ @Deprecated
public TarArchiveInputStream(final InputStream inputStream, final String
encoding) {
this(inputStream, TarConstants.DEFAULT_BLKSIZE,
TarConstants.DEFAULT_RCDSIZE, encoding);
}