Top Deprecated
Apache Commons Compress 1.26.0

Deprecated API


No API in this release is deprecated for removal.

Deprecated Item Summary

SinceDeprecated Item and Description

Returns:

the number of read bytes
org.apache.commons.compress.archivers.ArchiveInputStream.getCount
()

this method may yield wrong results for large archives, use getBytesRead() instead.

Returns:

the number of written bytes
org.apache.commons.compress.archivers.ArchiveOutputStream.getCount
()

this method may yield wrong results for large archives, use #getBytesWritten instead

org.apache.commons.compress.archivers.ArchiveStreamFactory.setEntryEncoding(final String
the entry encoding, null uses the archiver default.
entryEncoding
)

1.10 use ArchiveStreamFactory(String) to specify the encoding

Returns:

the number of bytes needed to pad the header (0,1,2,3)
org.apache.commons.compress.archivers.cpio.CpioArchiveEntry.getHeaderPadCount
()

This method doesn't properly work for multi-byte encodings. And creates corrupt archives. Use getHeaderPadCount(Charset) or getHeaderPadCount(long) in any case.

org.apache.commons.compress.archivers.examples.Archiver.create(final String
the archive format. This uses the same format as accepted by ArchiveStreamFactory.
format
,
final OutputStream
the stream to write the new archive to.
target
,
final File
the directory that contains the files to archive.
directory
)

this method leaks resources

org.apache.commons.compress.archivers.examples.Archiver.create(final String
the archive format. This uses the same format as accepted by ArchiveStreamFactory.
format
,
final SeekableByteChannel
the channel to write the new archive to.
target
,
final File
the directory that contains the files to archive.
directory
)

this method leaks resources

org.apache.commons.compress.archivers.examples.Expander.expand(final InputStream
the file to expand
archive
,
final File
the target directory
targetDirectory
)

this method leaks resources

org.apache.commons.compress.archivers.examples.Expander.expand(final String
the archive format. This uses the same format as accepted by ArchiveStreamFactory.
format
,
final InputStream
the file to expand
archive
,
final File
the target directory
targetDirectory
)

this method leaks resources

org.apache.commons.compress.archivers.examples.Expander.expand(final String
the archive format. This uses the same format as accepted by ArchiveStreamFactory.
format
,
final SeekableByteChannel
the file to expand
archive
,
final File
the target directory
targetDirectory
)

this method leaks resources

Returns:

Always returns null in the current implementation
org.apache.commons.compress.archivers.jar.JarArchiveEntry.getCertificates
()

since 1.5, not currently implemented

Returns:

Always returns null.
org.apache.commons.compress.archivers.jar.JarArchiveEntry.getManifestAttributes
()

since 1.5, do not use; always returns null

Returns:

the Java time
org.apache.commons.compress.archivers.sevenz.SevenZArchiveEntry.ntfsTimeToJavaTime
(final long
the NTFS time in 100 nanosecond units
ntfsTime
)

Use FileTimes#ntfsTimeToDate(long) instead.

org.apache.commons.compress.archivers.sevenz.SevenZArchiveEntry.setCompressedCrc(final int
the CRC
crc
)

use setCompressedCrcValue instead.

org.apache.commons.compress.archivers.sevenz.SevenZArchiveEntry.setCrc(final int
the CRC
crc
)

use setCrcValue instead.

org.apache.commons.compress.archivers.sevenz.SevenZFile.SevenZFile(final File
the file to read
file
,
final byte[]
optional password if the archive is encrypted - the byte array is supposed to be the UTF16-LE encoded representation of the password.
password
)

Use Builder#get().

org.apache.commons.compress.archivers.sevenz.SevenZFile.SevenZFile(final File
the file to read
file
,
final char[]
optional password if the archive is encrypted
password
)

Use Builder#get().

org.apache.commons.compress.archivers.sevenz.SevenZFile.SevenZFile(final File
the file to read
file
,
final char[]
optional password if the archive is encrypted
password
,
final SevenZFileOptions
the options to apply
options
)

Use Builder#get().

org.apache.commons.compress.archivers.sevenz.SevenZFile.SevenZFile(final File
the file to read
file
,
final SevenZFileOptions
the options to apply
options
)

Use Builder#get().

org.apache.commons.compress.archivers.sevenz.SevenZFile.SevenZFile(final SeekableByteChannel
the channel to read
channel
,
final byte[]
optional password if the archive is encrypted - the byte array is supposed to be the UTF16-LE encoded representation of the password.
password
)

Use Builder#get().

org.apache.commons.compress.archivers.sevenz.SevenZFile.SevenZFile(final SeekableByteChannel
the channel to read
channel
,
final char[]
optional password if the archive is encrypted
password
)

Use Builder#get().

org.apache.commons.compress.archivers.sevenz.SevenZFile.SevenZFile(final SeekableByteChannel
the channel to read
channel
,
final char[]
optional password if the archive is encrypted
password
,
final SevenZFileOptions
the options to apply
options
)

Use Builder#get().

org.apache.commons.compress.archivers.sevenz.SevenZFile.SevenZFile(final SeekableByteChannel
the channel to read
channel
,
final SevenZFileOptions
the options to apply
options
)

Use Builder#get().

org.apache.commons.compress.archivers.sevenz.SevenZFile.SevenZFile(final SeekableByteChannel
the channel to read
channel
,
final String
name of the archive - only used for error reporting
fileName
)

Use Builder#get().

org.apache.commons.compress.archivers.sevenz.SevenZFile.SevenZFile(final SeekableByteChannel
the channel to read
channel
,
final String
name of the archive - only used for error reporting
fileName
,
final byte[]
optional password if the archive is encrypted - the byte array is supposed to be the UTF16-LE encoded representation of the password.
password
)

Use Builder#get().

org.apache.commons.compress.archivers.sevenz.SevenZFile.SevenZFile(final SeekableByteChannel
the channel to read.
channel
,
final String
name of the archive - only used for error reporting.
fileName
,
final byte[]
optional password if the archive is encrypted.
password
,
final boolean
closes the channel on error.
closeOnError
,
final SevenZFileOptions
options.
options
)

Use Builder#get().

org.apache.commons.compress.archivers.sevenz.SevenZFile.SevenZFile(final SeekableByteChannel
the channel to read
channel
,
final String
name of the archive - only used for error reporting
fileName
,
final char[]
optional password if the archive is encrypted
password
)

Use Builder#get().

org.apache.commons.compress.archivers.sevenz.SevenZFile.SevenZFile(final SeekableByteChannel
the channel to read
channel
,
final String
name of the archive - only used for error reporting
fileName
,
final char[]
optional password if the archive is encrypted
password
,
final SevenZFileOptions
the options to apply
options
)

Use Builder#get().

org.apache.commons.compress.archivers.sevenz.SevenZFile.SevenZFile(final SeekableByteChannel
the channel to read
channel
,
final String
name of the archive - only used for error reporting
fileName
,
final SevenZFileOptions
the options to apply
options
)

Use Builder#get().

Returns:

configured SevenZFileOptions.
org.apache.commons.compress.archivers.sevenz.SevenZFileOptions.Builder.build
()

Deprecated as a consequence of SevenZFileOptions being deprecated. See corresponding docs for further information.

org.apache.commons.compress.archivers.sevenz.SevenZFileOptions.DEFAULT

Deprecated as a consequence of SevenZFileOptions being deprecated. See corresponding docs for further information.

Returns:

This entry's group id.
org.apache.commons.compress.archivers.tar.TarArchiveEntry.getGroupId
()

use #getLongGroupId instead as group ids can be bigger than Integer#MAX_VALUE

Returns:

This entry's user id.
org.apache.commons.compress.archivers.tar.TarArchiveEntry.getUserId
()

use #getLongUserId instead as user ids can be bigger than Integer#MAX_VALUE

org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.TarArchiveOutputStream(final OutputStream
the output stream to use
os
,
final int
the block size to use
blockSize
,
final int
the record size to use. Must be 512 bytes.
recordSize
)

recordSize must always be 512 bytes. An IllegalArgumentException will be thrown if any other value is used

org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.TarArchiveOutputStream(final OutputStream
the output stream to use
os
,
final int
the block size to use . Must be a multiple of 512 bytes.
blockSize
,
final int
the record size to use. Must be 512 bytes.
recordSize
,
final String
name of the encoding to use for file names
encoding
)

recordSize must always be 512 bytes. An IllegalArgumentException will be thrown if any other value is used.

Returns:

sparse headers parsed from sparse map
org.apache.commons.compress.archivers.tar.TarUtils.parsePAX01SparseHeaders
(final String
the sparse map string consisting of comma-separated values "offset,size[,offset-1,size-1...]"
sparseMap
)

use #parseFromPAX01SparseHeaders instead

Returns:

map of PAX headers values found inside the current (local or global) PAX headers tar entry.
org.apache.commons.compress.archivers.tar.TarUtils.parsePaxHeaders
(final InputStream
input stream to read keys and values
inputStream
,
final List<TarArchiveStructSparse>
used in PAX Format 0.0 & 0.1, as it may appear multiple times, the sparse headers need to be stored in an array, not a map
sparseHeaders
,
final Map<String, String>
global PAX headers of the tar archive
globalPaxHeaders
)

use the four-arg version instead

org.apache.commons.compress.archivers.zip.ExtraFieldUtils.register(final Class<?>
the class to register.
clazz
)

Use ZipArchiveInputStream#setExtraFieldSupport instead to not leak instances between archives and applications.

org.apache.commons.compress.archivers.zip.ZipFile.ZipFile(final File
the archive.
file
,
final String
the encoding to use for file names, use null for the platform's default encoding
encoding
)

Use Builder#get().

org.apache.commons.compress.archivers.zip.ZipFile.ZipFile(final File
the archive.
file
,
final String
the encoding to use for file names, use null for the platform's default encoding
encoding
,
final boolean
whether to use InfoZIP Unicode Extra Fields (if present) to set the file names.
useUnicodeExtraFields
)

Use Builder#get().

org.apache.commons.compress.archivers.zip.ZipFile.ZipFile(final File
the archive.
file
,
final String
the encoding to use for file names, use null for the platform's default encoding
encoding
,
final boolean
whether to use InfoZIP Unicode Extra Fields (if present) to set the file names.
useUnicodeExtraFields
,
final boolean
whether to ignore information stored inside the local file header (see the notes in this method's Javadoc)
ignoreLocalFileHeader
)

Use Builder#get().

org.apache.commons.compress.archivers.zip.ZipFile.ZipFile(final Path
path to the archive.
path
,
final String
the encoding to use for file names, use null for the platform's default encoding
encoding
)

Use Builder#get().

org.apache.commons.compress.archivers.zip.ZipFile.ZipFile(final Path
path to the archive.
path
,
final String
the encoding to use for file names, use null for the platform's default encoding
encoding
,
final boolean
whether to use InfoZIP Unicode Extra Fields (if present) to set the file names.
useUnicodeExtraFields
)

Use Builder#get().

org.apache.commons.compress.archivers.zip.ZipFile.ZipFile(final Path
path to the archive.
path
,
final String
the encoding to use for file names, use null for the platform's default encoding
encoding
,
final boolean
whether to use InfoZIP Unicode Extra Fields (if present) to set the file names.
useUnicodeExtraFields
,
final boolean
whether to ignore information stored inside the local file header (see the notes in this method's Javadoc)
ignoreLocalFileHeader
)

Use Builder#get().

org.apache.commons.compress.archivers.zip.ZipFile.ZipFile(final SeekableByteChannel
the archive.
channel
,
final String
the encoding to use for file names, use null for the platform's default encoding
encoding
)

Use Builder#get().

org.apache.commons.compress.archivers.zip.ZipFile.ZipFile(final SeekableByteChannel
the archive.
channel
,
final String
description of the archive, used for error messages only.
channelDescription
,
final String
the encoding to use for file names, use null for the platform's default encoding
encoding
,
final boolean
whether to use InfoZIP Unicode Extra Fields (if present) to set the file names.
useUnicodeExtraFields
)

Use Builder#get().

org.apache.commons.compress.archivers.zip.ZipFile.ZipFile(final SeekableByteChannel
the archive.
channel
,
final String
description of the archive, used for error messages only.
channelDescription
,
final String
the encoding to use for file names, use null for the platform's default encoding
encoding
,
final boolean
whether to use InfoZIP Unicode Extra Fields (if present) to set the file names.
useUnicodeExtraFields
,
final boolean
whether to ignore information stored inside the local file header (see the notes in this method's Javadoc)
ignoreLocalFileHeader
)

Use Builder#get().

org.apache.commons.compress.archivers.zip.ZipFile.ZipFile(final String
name of the archive.
name
,
final String
the encoding to use for file names, use null for the platform's default encoding
encoding
)

Use Builder#get().

Returns:

the number of read bytes
org.apache.commons.compress.compressors.CompressorInputStream.getCount
()

this method may yield wrong results for large archives, use #getBytesRead instead

org.apache.commons.compress.compressors.CompressorStreamFactory.setDecompressConcatenated(final boolean
if true, decompress until the end of the input; if false, stop after the first stream and leave the input position to point to the next byte after the stream
decompressConcatenated
)

1.10 use the CompressorStreamFactory(boolean) constructor instead

Returns:

name of the corresponding compressed file
org.apache.commons.compress.compressors.FileNameUtil.getCompressedFilename
(final String
name of a file
fileName
)

Use getCompressedFileName(String).

Returns:

name of the corresponding uncompressed file
org.apache.commons.compress.compressors.FileNameUtil.getUncompressedFilename
(final String
name of a file
fileName
)

Use getUncompressedFileName(String).

Returns:

true if the file name has a common format suffix, false otherwise
org.apache.commons.compress.compressors.FileNameUtil.isCompressedFilename
(final String
name of a file
fileName
)

Use isCompressedFileName(String).

Returns:

name of the corresponding compressed file
org.apache.commons.compress.compressors.bzip2.BZip2Utils.getCompressedFilename
(final String
name of a file
fileName
)

Use getCompressedFileName(String).

Returns:

name of the corresponding uncompressed file
org.apache.commons.compress.compressors.bzip2.BZip2Utils.getUncompressedFilename
(final String
name of a file
fileName
)

Use getUncompressedFileName(String).

Returns:

true if the file name has a common bzip2 suffix, false otherwise
org.apache.commons.compress.compressors.bzip2.BZip2Utils.isCompressedFilename
(final String
name of a file
fileName
)

Use isCompressedFileName(String).

org.apache.commons.compress.compressors.gzip.GzipParameters.setFilename(final String
the name of the file without the directory path
fileName
)

Use setFileName(String).

Returns:

name of the corresponding compressed file
org.apache.commons.compress.compressors.gzip.GzipUtils.getCompressedFilename
(final String
name of a file
fileName
)

Use getCompressedFileName(String).

Returns:

name of the corresponding uncompressed file
org.apache.commons.compress.compressors.gzip.GzipUtils.getUncompressedFilename
(final String
name of a file
fileName
)

Use getUncompressedFileName(String).

Returns:

true if the file name has a common gzip suffix, false otherwise
org.apache.commons.compress.compressors.gzip.GzipUtils.isCompressedFilename
(final String
name of a file
fileName
)

Use isCompressedFileName(String).

Returns:

name of the corresponding compressed file
org.apache.commons.compress.compressors.lzma.LZMAUtils.getCompressedFilename
(final String
name of a file
fileName
)

Use getCompressedFileName(String).

Returns:

name of the corresponding uncompressed file
org.apache.commons.compress.compressors.lzma.LZMAUtils.getUncompressedFilename
(final String
name of a file
fileName
)

Use getUncompressedFileName(String).

Returns:

true if the file name has a common LZMA suffix, false otherwise
org.apache.commons.compress.compressors.lzma.LZMAUtils.isCompressedFilename
(final String
name of a file
fileName
)

Use isCompressedFileName(String).

Returns:

name of the corresponding compressed file
org.apache.commons.compress.compressors.xz.XZUtils.getCompressedFilename
(final String
name of a file
fileName
)

Use getCompressedFileName(String).

Returns:

name of the corresponding uncompressed file
org.apache.commons.compress.compressors.xz.XZUtils.getUncompressedFilename
(final String
name of a file
fileName
)

Use getUncompressedFileName(String).

Returns:

true if the file name has a common xz suffix, false otherwise
org.apache.commons.compress.compressors.xz.XZUtils.isCompressedFilename
(final String
name of a file
fileName
)

Use isCompressedFileName(String).

Returns:

true if buffer1 and buffer2 have same contents
org.apache.commons.compress.utils.ArchiveUtils.isEqual
(final byte[]
the first buffer
buffer1
,
final byte[]
the second buffer
buffer2
)

Use Arrays#equals(byte[], byte[]).

Returns:

the number read
org.apache.commons.compress.utils.ByteUtils.fromLittleEndian
(final InputStream
the stream to read from
in
,
final int
the number of bytes representing the value
length
)

Unused

org.apache.commons.compress.utils.ByteUtils.toLittleEndian(final DataOutput
the output to write to
out
,
final long
the value to write
value
,
final int
the number of bytes to use to represent the value
length
)

Unused

org.apache.commons.compress.utils.CRC32VerifyingInputStream.CRC32VerifyingInputStream(final InputStream
the stream to wrap
in
,
final long
the of the stream's content
size
,
final int
the expected checksum
expectedCrc32
)

No longer used.

Returns:

the base name of file name
org.apache.commons.compress.utils.FileNameUtils.getBaseName
(final String
the name of the file to obtain the base name of.
fileName
)

No longer used, no replacement.

Returns:

the extension of file name
org.apache.commons.compress.utils.FileNameUtils.getExtension
(final String
the name of the file to obtain the extension of.
fileName
)

Use FilenameUtils#getExtension(String).

org.apache.commons.compress.utils.IOUtils.copy(final File
The file to read.
sourceFile
,
final OutputStream
The output stream to write.
outputStream
)

Use FileUtils#copyFile(File, OutputStream).

Returns:

the number of bytes copied
org.apache.commons.compress.utils.IOUtils.copy
(final InputStream
the InputStream to copy
input
,
final OutputStream
the target, may be null to simulate output to dev/null on Linux and NUL on Windows
output
)

Use org.apache.commons.io.IOUtils#copy(InputStream, OutputStream).

Returns:

the number of bytes copied
org.apache.commons.compress.utils.IOUtils.copy
(final InputStream
the InputStream to copy
input
,
final OutputStream
the target, may be null to simulate output to dev/null on Linux and NUL on Windows
output
,
final int
the buffer size to use, must be bigger than 0
bufferSize
)

Use org.apache.commons.io.IOUtils#copy(InputStream, OutputStream, int).

Returns:

the number of bytes copied
org.apache.commons.compress.utils.IOUtils.copyRange
(final InputStream
the InputStream to copy
input
,
final long
maximum amount of bytes to copy
len
,
final OutputStream
the target Stream
output
)

Use org.apache.commons.io.IOUtils#copyLarge(InputStream, OutputStream, long, long).

Returns:

the number of bytes copied
org.apache.commons.compress.utils.IOUtils.copyRange
(final InputStream
the InputStream to copy
input
,
final long
maximum amount of bytes to copy
length
,
final OutputStream
the target, may be null to simulate output to dev/null on Linux and NUL on Windows
output
,
final int
the buffer size to use, must be bigger than 0
bufferSize
)

No longer used.

Returns:

the number of bytes actually read
org.apache.commons.compress.utils.IOUtils.read
(final File
file to read
file
,
final byte[]
buffer to fill
array
)

Use Files#readAllBytes(java.nio.file.Path).

Returns:

the number of bytes actually skipped
org.apache.commons.compress.utils.IOUtils.skip
(final InputStream
stream to skip bytes in
input
,
final long
the number of bytes to skip
numToSkip
)

Use org.apache.commons.io.IOUtils#skip(InputStream, long).

Returns:

the requested byte array
org.apache.commons.compress.utils.IOUtils.toByteArray
(final InputStream
the InputStream to read from
input
)

Use org.apache.commons.io.IOUtils#toByteArray(InputStream).

org.apache.commons.compress.utils.ServiceLoaderIterator<
The service to load
E
>

No longer needed.

Returns:

the Date.
org.apache.commons.compress.utils.TimeUtils.ntfsTimeToDate
(final long
the NTFS time in 100 nanosecond units.
ntfsTime
)

Use FileTimes#ntfsTimeToDate(long).

Returns:

the FileTime.
org.apache.commons.compress.utils.TimeUtils.ntfsTimeToFileTime
(final long
the NTFS time in 100-nanosecond units.
ntfsTime
)

Use FileTimes#ntfsTimeToFileTime(long).

Returns:

a Date which corresponds to the supplied time, or null if the time is null.
org.apache.commons.compress.utils.TimeUtils.toDate
(final FileTime
the file time to be converted.
fileTime
)

Use FileTimes#toDate(FileTime).

Returns:

a FileTime which corresponds to the supplied date, or null if the date is null.
org.apache.commons.compress.utils.TimeUtils.toFileTime
(final Date
the date to be converted.
date
)

Use FileTimes#toFileTime(Date).

Returns:

the NTFS time in 100-nanosecond units.
org.apache.commons.compress.utils.TimeUtils.toNtfsTime
(final FileTime
the FileTime.
fileTime
)

Use FileTimes#toNtfsTime(FileTime).