public class ExtractTarEntryExtractionStrategy extends Object implements TarEntryExtractionStrategy
TarExtractor
.
The object can be configured to ignore symbolic link entries. If symbolic
links are not ignore, and this object gets a symbolic link entry, it throws a
TarFileParseException
.
TarExtractSpecification
Constructor and Description |
---|
ExtractTarEntryExtractionStrategy(boolean ignoreSymbolicLinks) |
Modifier and Type | Method and Description |
---|---|
void |
extract(TarEntryHeaderData headerData,
org.entityfs.DataSource src,
org.entityfs.Directory targetRoot,
TarExtractSpecification spec)
Extract the current Tar entry.
|
protected void |
extractDirectory(TarEntryHeaderData headerData,
org.entityfs.DataSource src,
org.entityfs.Directory targetRoot,
TarExtractSpecification spec) |
protected void |
extractFile(TarEntryHeaderData headerData,
org.entityfs.DataSource src,
org.entityfs.Directory targetRoot,
TarExtractSpecification spec) |
protected void |
extractSymbolicLink(TarEntryHeaderData headerData,
org.entityfs.DataSource src,
org.entityfs.Directory targetRoot,
TarExtractSpecification spec) |
protected org.entityfs.Directory |
getDirectory(org.entityfs.Directory targetRoot,
org.entityfs.el.AbsoluteLocation loc) |
protected boolean |
isIgnoreSymbolicLinks() |
protected void |
skipToNextBlockBoundary(org.entityfs.DataSource src,
long leastNoToForwardFromLast) |
public ExtractTarEntryExtractionStrategy(boolean ignoreSymbolicLinks)
protected boolean isIgnoreSymbolicLinks()
protected org.entityfs.Directory getDirectory(org.entityfs.Directory targetRoot, org.entityfs.el.AbsoluteLocation loc)
protected void skipToNextBlockBoundary(org.entityfs.DataSource src, long leastNoToForwardFromLast)
protected void extractDirectory(TarEntryHeaderData headerData, org.entityfs.DataSource src, org.entityfs.Directory targetRoot, TarExtractSpecification spec)
protected void extractFile(TarEntryHeaderData headerData, org.entityfs.DataSource src, org.entityfs.Directory targetRoot, TarExtractSpecification spec)
protected void extractSymbolicLink(TarEntryHeaderData headerData, org.entityfs.DataSource src, org.entityfs.Directory targetRoot, TarExtractSpecification spec)
public void extract(TarEntryHeaderData headerData, org.entityfs.DataSource src, org.entityfs.Directory targetRoot, TarExtractSpecification spec) throws org.entityfs.support.exception.WrappedIOException, TarFileParseException
TarEntryExtractionStrategy
extract
in interface TarEntryExtractionStrategy
headerData
- The Tar entry's header data.src
- The data source. When this method is called, the data source
is positioned at the start of the entry data, at a Tar block start. When
this method exits, it should be positioned at the next Tar block start,
after the entry data.targetRoot
- The root directory of the extraction target directory
hierarchy.spec
- The specification for the extraction operation.org.entityfs.support.exception.WrappedIOException
- On I/O errors.TarFileParseException
- If the extraction strategy does not know
how to deal with the entry.