| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private static final ZipEncoding | |
| protected byte[] | |
| protected int | |
| public static final int | BIGNUMBER_ERROR
Fail if a big number (e.g. size > 8GiB) is required in the archive. |
| public static final int | BIGNUMBER_POSIX
POSIX/PAX extensions are used to store big numbers in the archive. |
| public static final int | BIGNUMBER_STAR
star/GNU tar/BSD tar extensions are used to store big number in the archive. |
| private int | |
| protected TarBuffer | |
| private boolean | |
| protected long | |
| protected String | |
| protected long | |
| protected boolean | |
| private final ZipEncoding | |
| private boolean | finished
indicates if this archive is finished |
| private boolean | haveUnclosedEntry
Indicates if putNextEntry has been called without closeEntry |
| public static final int | LONGFILE_ERROR
Fail if a long file name is required in the archive. |
| public static final int | LONGFILE_GNU
GNU tar extensions are used to store long file names in the archive. |
| public static final int | LONGFILE_POSIX
POSIX/PAX extensions are used to store long file names in the archive. |
| public static final int | LONGFILE_TRUNCATE
Long paths will be truncated in the archive. |
| protected int | |
| protected byte[] | |
| protected byte[] |
| Access | Constructor and Description |
|---|---|
| public | |
| public | TarOutputStream(OutputStream
the output stream to use os, String name of the encoding to use for file names encoding)Constructor for TarInputStream. |
| public | TarOutputStream(OutputStream
the output stream to use os, int the block size to use blockSize)Constructor for TarInputStream. |
| public | TarOutputStream(OutputStream
the output stream to use os, int the block size to use blockSize, String name of the encoding to use for file names encoding)Constructor for TarInputStream. |
| public | TarOutputStream(OutputStream
the output stream to use os, int the block size to use blockSize, int the record size to use recordSize)Constructor for TarInputStream. |
| public | TarOutputStream(OutputStream
the output stream to use os, int the block size to use blockSize, int the record size to use recordSize, String name of the encoding to use for file names encoding)Constructor for TarInputStream. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | |
| public void | close()
Overrides java. Implements java. |
| public void | |
| private void | |
| private void | |
| private void | |
| private void | |
| public void | |
| public int | Returns: The TarBuffer record size.Get the record size being used by this stream's TarBuffer. |
| private boolean | Returns: whether a pax header has been written.entry the name belongs to entry, String the name to write name, Map<String, String> current map of pax headers paxHeaders, String name of the pax header to write paxHeaderName, byte type of the GNU entry to write linkType, String the name of the field fieldName)Handles long file or link names according to the longFileMode setting. |
| public void | putNextEntry(TarEntry
The TarEntry to be written to the archive. entry)Put an entry on the output stream. |
| public void | setAddPaxHeadersForNonAsciiNames(boolean
boolean b)Whether to add a PAX extension header for non-ASCII file names. |
| public void | |
| public void | setBufferDebug(boolean
True to turn on debugging. debug)Sets the debugging flag in this stream's TarBuffer. |
| public void | |
| public void | |
| private String | |
| private void | |
| public void | write(int
The byte written. b)Overrides java. |
| public void | write(byte[]
The buffer to write to the archive. wBuf)Overrides java. |
| public void | write(byte[]
The buffer to write to the archive. wBuf, int The offset in the buffer from which to get bytes. wOffset, int The number of bytes to write. numToWrite)Overrides java. |
| private void | |
| pack-priv void |
| addPaxHeadersForNonAsciiNames | back to summary |
|---|---|
| private boolean addPaxHeadersForNonAsciiNames | |
| ASCII | back to summary |
|---|---|
| private static final ZipEncoding ASCII | |
| assemBuf | back to summary |
|---|---|
| protected byte[] assemBuf | |
| assemLen | back to summary |
|---|---|
| protected int assemLen | |
| BIGNUMBER_ERROR | back to summary |
|---|---|
| public static final int BIGNUMBER_ERROR Fail if a big number (e.g. size > 8GiB) is required in the archive. | |
| BIGNUMBER_POSIX | back to summary |
|---|---|
| public static final int BIGNUMBER_POSIX POSIX/PAX extensions are used to store big numbers in the archive. | |
| BIGNUMBER_STAR | back to summary |
|---|---|
| public static final int BIGNUMBER_STAR star/GNU tar/BSD tar extensions are used to store big number in the archive. | |
| bigNumberMode | back to summary |
|---|---|
| private int bigNumberMode | |
| buffer | back to summary |
|---|---|
| protected TarBuffer buffer | |
| closed | back to summary |
|---|---|
| private boolean closed | |
| currBytes | back to summary |
|---|---|
| protected long currBytes | |
| currName | back to summary |
|---|---|
| protected String currName | |
| currSize | back to summary |
|---|---|
| protected long currSize | |
| debug | back to summary |
|---|---|
| protected boolean debug | |
| encoding | back to summary |
|---|---|
| private final ZipEncoding encoding | |
| finished | back to summary |
|---|---|
| private boolean finished indicates if this archive is finished | |
| haveUnclosedEntry | back to summary |
|---|---|
| private boolean haveUnclosedEntry Indicates if putNextEntry has been called without closeEntry | |
| LONGFILE_ERROR | back to summary |
|---|---|
| public static final int LONGFILE_ERROR Fail if a long file name is required in the archive. | |
| LONGFILE_GNU | back to summary |
|---|---|
| public static final int LONGFILE_GNU GNU tar extensions are used to store long file names in the archive. | |
| LONGFILE_POSIX | back to summary |
|---|---|
| public static final int LONGFILE_POSIX POSIX/PAX extensions are used to store long file names in the archive. | |
| LONGFILE_TRUNCATE | back to summary |
|---|---|
| public static final int LONGFILE_TRUNCATE Long paths will be truncated in the archive. | |
| longFileMode | back to summary |
|---|---|
| protected int longFileMode | |
| oneBuf | back to summary |
|---|---|
| protected byte[] oneBuf | |
| recordBuf | back to summary |
|---|---|
| protected byte[] recordBuf | |
| TarOutputStream | back to summary |
|---|---|
| public TarOutputStream(OutputStream os) Constructor for TarInputStream.
| |
| TarOutputStream | back to summary |
|---|---|
| public TarOutputStream(OutputStream os, String encoding) Constructor for TarInputStream.
| |
| TarOutputStream | back to summary |
|---|---|
| public TarOutputStream(OutputStream os, int blockSize) Constructor for TarInputStream.
| |
| TarOutputStream | back to summary |
|---|---|
| public TarOutputStream(OutputStream os, int blockSize, String encoding) Constructor for TarInputStream.
| |
| TarOutputStream | back to summary |
|---|---|
| public TarOutputStream(OutputStream os, int blockSize, int recordSize) Constructor for TarInputStream.
| |
| TarOutputStream | back to summary |
|---|---|
| public TarOutputStream(OutputStream os, int blockSize, int recordSize, String encoding) Constructor for TarInputStream.
| |
| addPaxHeaderForBigNumber | back to summary |
|---|---|
| private void addPaxHeaderForBigNumber(Map<String, String> paxHeaders, String header, long value, long maxValue) | |
| addPaxHeadersForBigNumbers | back to summary |
|---|---|
| private void addPaxHeadersForBigNumbers(Map<String, String> paxHeaders, TarEntry entry) | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Ends the TAR archive and closes the underlying OutputStream. This means that finish() is called followed by calling the TarBuffer's close().
| |
| closeEntry | back to summary |
|---|---|
| public void closeEntry() throws IOException Close an entry. This method MUST be called for all file entries that contain data. The reason is that we must buffer data written to the stream in order to satisfy the buffer's record based writes. Thus, there may be data fragments still being assembled that must be written to the output stream before this entry is closed and the next entry written.
| |
| failForBigNumber | back to summary |
|---|---|
| private void failForBigNumber(String field, long value, long maxValue) | |
| failForBigNumber | back to summary |
|---|---|
| private void failForBigNumber(String field, long value, long maxValue, String additionalMsg) | |
| failForBigNumbers | back to summary |
|---|---|
| private void failForBigNumbers(TarEntry entry) | |
| failForBigNumberWithPosixMessage | back to summary |
|---|---|
| private void failForBigNumberWithPosixMessage(String field, long value, long maxValue) | |
| finish | back to summary |
|---|---|
| public void finish() throws IOException Ends the TAR archive without closing the underlying OutputStream. An archive consists of a series of file entries terminated by an end-of-archive entry, which consists of two 512 blocks of zero bytes. POSIX.1 requires two EOF records, like some other implementations.
| |
| getRecordSize | back to summary |
|---|---|
| public int getRecordSize() Get the record size being used by this stream's TarBuffer.
| |
| handleLongName | back to summary |
|---|---|
| private boolean handleLongName(TarEntry entry, String name, Map<String, String> paxHeaders, String paxHeaderName, byte linkType, String fieldName) throws IOException Handles long file or link names according to the longFileMode setting. I.e. if the given name is too long to be written to a plain tar header then
| |
| putNextEntry | back to summary |
|---|---|
| public void putNextEntry(TarEntry entry) throws IOException Put an entry on the output stream. This writes the entry's header record and positions the output stream for writing the contents of the entry. Once this method is called, the stream is ready for calls to write() to write the entry's contents. Once the contents are written, closeEntry() MUST be called to ensure that all buffered data is completely written to the output stream.
| |
| setAddPaxHeadersForNonAsciiNames | back to summary |
|---|---|
| public void setAddPaxHeadersForNonAsciiNames(boolean b) Whether to add a PAX extension header for non-ASCII file names.
| |
| setBigNumberMode | back to summary |
|---|---|
| public void setBigNumberMode(int bigNumberMode) Set the big number mode. This can be BIGNUMBER_ERROR(0), BIGNUMBER_POSIX(1) or BIGNUMBER_STAR(2). This specifies the treatment of big files (sizes > TarConstants.MAXSIZE) and other numeric values to big to fit into a traditional tar header. Default is BIGNUMBER_ERROR.
| |
| setBufferDebug | back to summary |
|---|---|
| public void setBufferDebug(boolean debug) Sets the debugging flag in this stream's TarBuffer.
| |
| setDebug | back to summary |
|---|---|
| public void setDebug(boolean debugF) Sets the debugging flag.
| |
| setLongFileMode | back to summary |
|---|---|
| public void setLongFileMode(int longFileMode) Set the long file mode. This can be LONGFILE_ERROR(0), LONGFILE_TRUNCATE(1) or LONGFILE_GNU(2). This specifies the treatment of long file names (names >= TarConstants.NAMELEN). Default is LONGFILE_ERROR.
| |
| stripTo7Bits | back to summary |
|---|---|
| private String stripTo7Bits(String name) | |
| transferModTime | back to summary |
|---|---|
| private void transferModTime(TarEntry from, TarEntry to) | |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Overrides java. Writes a byte to the current tar archive entry. This method simply calls read(byte[], int, int).
| |
| write | back to summary |
|---|---|
| public void write(byte[] wBuf) throws IOException Overrides java. Writes bytes to the current tar archive entry. This method simply calls write(byte[], int, int).
| |
| write | back to summary |
|---|---|
| public void write(byte[] wBuf, int wOffset, int numToWrite) throws IOException Overrides java. Writes bytes to the current tar archive entry. This method is aware of the current entry and will throw an exception if you attempt to write bytes past the length specified for the current entry. The method is also (painfully) aware of the record buffering required by TarBuffer, and manages buffers that are not a multiple of recordsize in length, including assembling records from small buffers.
| |
| writeEOFRecord | back to summary |
|---|---|
| private void writeEOFRecord() throws IOException Write an EOF (end of archive) record to the tar archive. An EOF record consists of a record of all zeros. | |
| writePaxHeaders | back to summary |
|---|---|
| pack-priv void writePaxHeaders(TarEntry entry, String entryName, Map<String, String> headers) throws IOException Writes a PAX extended header with the given map as contents. | |