public class TarFile
extends java.lang.Object
implements java.io.Closeable
Constructor and Description |
---|
TarFile(byte[] content)
Constructor for TarFile.
|
TarFile(byte[] content,
boolean lenient)
Constructor for TarFile.
|
TarFile(byte[] content,
java.lang.String encoding)
Constructor for TarFile.
|
TarFile(java.io.File archive)
Constructor for TarFile.
|
TarFile(java.io.File archive,
boolean lenient)
Constructor for TarFile.
|
TarFile(java.io.File archive,
java.lang.String encoding)
Constructor for TarFile.
|
TarFile(java.nio.file.Path archivePath)
Constructor for TarFile.
|
TarFile(java.nio.file.Path archivePath,
boolean lenient)
Constructor for TarFile.
|
TarFile(java.nio.file.Path archivePath,
java.lang.String encoding)
Constructor for TarFile.
|
TarFile(java.nio.channels.SeekableByteChannel content)
Constructor for TarFile.
|
TarFile(java.nio.channels.SeekableByteChannel archive,
int blockSize,
int recordSize,
java.lang.String encoding,
boolean lenient)
Constructor for TarFile.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
java.util.List<TarArchiveEntry> |
getEntries()
Get all TAR Archive Entries from the TarFile
|
java.io.InputStream |
getInputStream(TarArchiveEntry entry)
Gets the input stream for the provided Tar Archive Entry.
|
public TarFile(byte[] content) throws java.io.IOException
content
- the content to usejava.io.IOException
- when reading the tar archive failspublic TarFile(byte[] content, java.lang.String encoding) throws java.io.IOException
content
- the content to useencoding
- the encoding to usejava.io.IOException
- when reading the tar archive failspublic TarFile(byte[] content, boolean lenient) throws java.io.IOException
content
- the content to uselenient
- when set to true illegal values for group/userid, mode, device numbers and timestamp will be
ignored and the fields set to TarArchiveEntry.UNKNOWN
. When set to false such illegal fields cause an
exception instead.java.io.IOException
- when reading the tar archive failspublic TarFile(java.io.File archive) throws java.io.IOException
archive
- the file of the archive to usejava.io.IOException
- when reading the tar archive failspublic TarFile(java.io.File archive, java.lang.String encoding) throws java.io.IOException
archive
- the file of the archive to useencoding
- the encoding to usejava.io.IOException
- when reading the tar archive failspublic TarFile(java.io.File archive, boolean lenient) throws java.io.IOException
archive
- the file of the archive to uselenient
- when set to true illegal values for group/userid, mode, device numbers and timestamp will be
ignored and the fields set to TarArchiveEntry.UNKNOWN
. When set to false such illegal fields cause an
exception instead.java.io.IOException
- when reading the tar archive failspublic TarFile(java.nio.file.Path archivePath) throws java.io.IOException
archivePath
- the path of the archive to usejava.io.IOException
- when reading the tar archive failspublic TarFile(java.nio.file.Path archivePath, java.lang.String encoding) throws java.io.IOException
archivePath
- the path of the archive to useencoding
- the encoding to usejava.io.IOException
- when reading the tar archive failspublic TarFile(java.nio.file.Path archivePath, boolean lenient) throws java.io.IOException
archivePath
- the path of the archive to uselenient
- when set to true illegal values for group/userid, mode, device numbers and timestamp will be
ignored and the fields set to TarArchiveEntry.UNKNOWN
. When set to false such illegal fields cause an
exception instead.java.io.IOException
- when reading the tar archive failspublic TarFile(java.nio.channels.SeekableByteChannel content) throws java.io.IOException
content
- the content to usejava.io.IOException
- when reading the tar archive failspublic TarFile(java.nio.channels.SeekableByteChannel archive, int blockSize, int recordSize, java.lang.String encoding, boolean lenient) throws java.io.IOException
archive
- the seekable byte channel to useblockSize
- the blocks size to userecordSize
- the record size to useencoding
- the encoding to uselenient
- when set to true illegal values for group/userid, mode, device numbers and timestamp will be
ignored and the fields set to TarArchiveEntry.UNKNOWN
. When set to false such illegal fields cause an
exception instead.java.io.IOException
- when reading the tar archive failspublic java.util.List<TarArchiveEntry> getEntries()
public java.io.InputStream getInputStream(TarArchiveEntry entry) throws java.io.IOException
entry
- Entry to get the input stream fromjava.io.IOException
- Corrupted TAR archive. Can't read entry.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
Copyright © 2010 - 2023 Adobe. All Rights Reserved