public final class TarFileParser extends Object
DataSource
, parses Tar entry headers, and then uses a
delegate object of the type TarEntryHandlerDelegate
to handle the
entry in some way. TarFile
uses this to build a map of the Tar file
structure that it keeps in memory, and TarExtractor
uses this to
extract the Tar entries.
The Tar file parser object is stateless. Instead of instantiating it, the
singleton instance INSTANCE
may be used.
Modifier and Type | Field and Description |
---|---|
static TarFileParser |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
void |
parse(org.entityfs.DataSource src,
Charset fileNameCharset,
TarEntryHandlerDelegate entryHandler)
Parse the Tar file data read from the data source.
|
public static final TarFileParser INSTANCE
public void parse(org.entityfs.DataSource src, Charset fileNameCharset, TarEntryHandlerDelegate entryHandler) throws TarFileParseException, org.entityfs.support.exception.WrappedIOException
src
- The data source.fileNameCharset
- The charset to use for decoding entry names.entryHandler
- The delegate object that handles each parsed entry.TarFileParseException
- On parse errors.org.entityfs.support.exception.WrappedIOException
- On I/O errors.