|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.at4j.tar.TarExtractor
public class TarExtractor
This object is used to extract entries from a Tar archive. It does the same
as the ArchiveExtractor
, but is a bit faster
since it does not have to parse the Tar file before extracting it. (It parses
the Tar file while extracting it.)
Java's file system support sets a limit to how much entry metadata the extractor can extract. Currently, it only extracts the entry's last modification time.
The extraction process can be fine-tuned by configuring a
TarExtractSpecification
object and passing it to the extract method.
If the target is in a locking file system, the extractor automatically locks files and directories as required.
This class has a runnable main method. When run, it prints out the contents of a Tar file.
ArchiveExtractor
Constructor Summary | |
---|---|
TarExtractor(File f)
Create a new Tar extractor for the supplied file. |
|
TarExtractor(ReadableFile f)
Create a new Tar extractor for the supplied file. |
Method Summary | |
---|---|
void |
extract(DirectoryView target)
Extract the contents of the Tar file into a directory hierarchy starting with the target directory. |
void |
extract(DirectoryView target,
TarExtractSpecification spec)
Extract the contents of the Tar file into a directory hierarchy starting with the target directory. |
void |
extract(File target)
Extract the contents of the Tar file into a directory hierarchy starting with the target directory. |
void |
extract(File target,
TarExtractSpecification spec)
Extract the contents of the Tar file into a directory hierarchy starting with the target directory. |
protected void |
extractInternal(Directory target,
TarExtractSpecification spec)
|
static void |
main(String[] args)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TarExtractor(ReadableFile f)
Tip: GZipReadableFile
,
BZip2ReadableFile
and
LzmaReadableFile
can all be used here.
f
- The Tar file.public TarExtractor(File f)
f
- The Tar file.Method Detail |
---|
protected void extractInternal(Directory target, TarExtractSpecification spec)
public void extract(DirectoryView target) throws TarFileParseException, WrappedIOException
TarExtractSpecification
configuration.
target
- The target directory.
TarFileParseException
- On parse errors.
WrappedIOException
- On I/O errors.public void extract(DirectoryView target, TarExtractSpecification spec) throws TarFileParseException, WrappedIOException
target
- The target directory. This may be null if spec
is
configured with a TarEntryExtractionStrategy
that does not use a
target directory.spec
- Configuration for the extraction operation.
TarFileParseException
- On parse errors.
WrappedIOException
- On I/O errors.public void extract(File target) throws EntityNotFoundException, NotADirectoryException, TarFileParseException, WrappedIOException
TarExtractSpecification
configuration.
target
- The target directory.
TarFileParseException
- On parse errors.
WrappedIOException
- On I/O errors.
EntityNotFoundException
- If the target directory does not exist.
NotADirectoryException
- If the target is not a directory.public void extract(File target, TarExtractSpecification spec) throws EntityNotFoundException, NotADirectoryException, TarFileParseException, WrappedIOException
target
- The target directory. This may be null if spec
is
configured with a TarEntryExtractionStrategy
that does not use a
target directory.spec
- Configuration for the extraction operation.
TarFileParseException
- On parse errors.
WrappedIOException
- On I/O errors.
EntityNotFoundException
- If the target directory does not exist.
NotADirectoryException
- If the target is not a directory.public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |