java.io.Reader sense,
but in the sense of differentiating tar x and
tar t from tar c.Security Note
Due to pitiful lack of support for file security in Java before version 1.6, this class will only explicitly set permissions if it is compiled for Java 1.6. If it was not, and if your tar entries contain private data in files with 0400 or similar, be aware that they will be extracted with privs such that they can be ready by anybody.
| Modifier and Type | Class and Description |
|---|---|
| protected static class | TarReader.
A Tar entry header constituted from a header block in a tar file. |
| Modifier and Type | Field and Description |
|---|---|
| protected TarFileInputStream | |
| public static final int | EXTRACT_MODE
EXTRACT_MODE refuses to overwrite existing files. |
| protected File | |
| public static final int | |
| protected int | |
| public static final int | OVERWRITE_MODE
OVERWRITE_MODE is just EXTRACT_MODE where we will silently overwrite existing files upon extraction. |
| protected Pattern[] |
| Access | Constructor and Description |
|---|---|
| public | TarReader(File
Absolute or relative (from user.dir) path to
tar file to be read. Suffix may indicate
a compression method. inFile, int Whether to list, extract-without-overwrite, or
extract-with-overwrite. mode, String[] List of regular expressions to match against tar entry
names. If null, all entries will be listed or
extracted. If non-null, then only entries with names
which match will be extracted or listed. patternStrings, Integer Null will use default tar value. readBufferBlocks, File Directory that RELATIVE entries will be extracted
relative to. Defaults to current directory (user.dir).
Only used for extract modes and relative file entries. inDir)Compression is determined directly by the suffix of the file name in the specified path. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected PIFData | |
| public void | |
| protected void |
| archive | back to summary |
|---|---|
| protected TarFileInputStream archive | |
| EXTRACT_MODE | back to summary |
|---|---|
| public static final int EXTRACT_MODE EXTRACT_MODE refuses to overwrite existing files. | |
| extractBaseDir | back to summary |
|---|---|
| protected File extractBaseDir | |
| LIST_MODE | back to summary |
|---|---|
| public static final int LIST_MODE | |
| mode | back to summary |
|---|---|
| protected int mode | |
| OVERWRITE_MODE | back to summary |
|---|---|
| public static final int OVERWRITE_MODE OVERWRITE_MODE is just EXTRACT_MODE where we will silently overwrite existing files upon extraction. | |
| patterns | back to summary |
|---|---|
| protected Pattern[] patterns | |
| TarReader | back to summary |
|---|---|
| public TarReader(File inFile, int mode, String[] patternStrings, Integer readBufferBlocks, File inDir) throws IOException Compression is determined directly by the suffix of the file name in the specified path.
| |
| extractFile | back to summary |
|---|---|
| protected void extractFile(TarReader. | |
| getPifData | back to summary |
|---|---|
| protected PIFData getPifData(TarReader. | |
| read | back to summary |
|---|---|
| public void read() throws IOException, TarMalformatException | |
| skipFileData | back to summary |
|---|---|
| protected void skipFileData(TarReader. | |
| Modifier and Type | Class and Description |
|---|---|
| protected static class |
| Modifier and Type | Field and Description |
|---|---|
| protected long | |
| protected char | |
| protected int | |
| protected long | |
| protected String | |
| protected String | |
| protected byte[] | |
| protected SimpleDateFormat | |
| protected boolean |
| Access | Constructor and Description |
|---|---|
| public | TarEntryHeader(byte[]
May be longer than 512 bytes, but the first 512
bytes MUST COMPRISE a raw tar entry header. rawHeader)
|
| Modifier and Type | Method and Description |
|---|---|
| public File | |
| public long | |
| public char | |
| public int | |
| public long | |
| public String | |
| protected long | |
| public static int | |
| public boolean | |
| protected char | |
| protected Long | Returns: LongTarHeaderField field)Integer as in positive whole number, which does not imply Java types
of |
| protected String | |
| public void | |
| public String | Returns: StringOverrides java. Choosing not to report fields that we don't write (e.g. "gname"), but which would certainly be useful for a general Java tar client implementation. |
| dataSize | back to summary |
|---|---|
| protected long dataSize | |
| entryType | back to summary |
|---|---|
| protected char entryType | |
| fileMode | back to summary |
|---|---|
| protected int fileMode | |
| modTime | back to summary |
|---|---|
| protected long modTime | |
| ownerName | back to summary |
|---|---|
| protected String ownerName | |
| path | back to summary |
|---|---|
| protected String path | |
| rawHeader | back to summary |
|---|---|
| protected byte[] rawHeader | |
| sdf | back to summary |
|---|---|
| protected SimpleDateFormat sdf | |
| ustar | back to summary |
|---|---|
| protected boolean ustar | |
| TarEntryHeader | back to summary |
|---|---|
public TarEntryHeader(byte[] rawHeader) throws TarMalformatException
| |
| generateFile | back to summary |
|---|---|
public File generateFile()
| |
| getDataSize | back to summary |
|---|---|
| public long getDataSize() | |
| getEntryType | back to summary |
|---|---|
| public char getEntryType() | |
| getFileMode | back to summary |
|---|---|
| public int getFileMode() | |
| getModTime | back to summary |
|---|---|
| public long getModTime() | |
| getPath | back to summary |
|---|---|
| public String getPath() | |
| headerChecksum | back to summary |
|---|---|
| protected long headerChecksum() | |
| indexOf | back to summary |
|---|---|
public static int indexOf(byte[] ba, byte val, int from, int to)
| |
| isUstar | back to summary |
|---|---|
| public boolean isUstar() throws TarMalformatException Is this any UStar variant
| |
| readChar | back to summary |
|---|---|
| protected char readChar(TarHeaderField field) throws TarMalformatException | |
| readInteger | back to summary |
|---|---|
| protected Long readInteger(TarHeaderField field) throws TarMalformatException Integer as in positive whole number, which does not imply Java types
of
| |
| readString | back to summary |
|---|---|
protected String readString(TarHeaderField field) throws TarMalformatException
| |
| setDataSize | back to summary |
|---|---|
| public void setDataSize(long dataSize) Setter is needed in order to override header size setting for Pax.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Choosing not to report fields that we don't write (e.g. "gname"), but which would certainly be useful for a general Java tar client implementation. This design decision is subject to change.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final TarHeaderField |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | getMessage()
Overrides java. Returns the detail message string of this throwable. |
| field | back to summary |
|---|---|
| private final TarHeaderField field | |
| MissingField | back to summary |
|---|---|
| public MissingField(TarHeaderField field) | |
| getMessage | back to summary |
|---|---|
| public String getMessage() Overrides java. Doc from java. Returns the detail message string of this throwable. | |