public class ArchiveExtractor extends Object
An extraction operation is configured with an optional
ExtractSpecification
object. It can be used to fine-tune the
extraction process.
TarExtractor
Constructor and Description |
---|
ArchiveExtractor(Archive<?,?> archive)
Create a new archive extractor that extracts contents from the supplied
archive.
|
Modifier and Type | Method and Description |
---|---|
void |
extract(org.entityfs.DirectoryView target)
Extract all entries in the archive to the supplied directory.
|
void |
extract(org.entityfs.DirectoryView target,
ExtractSpecification spec)
Extract the archive entries that match the supplied filter to the target
directory.
|
void |
extract(File target)
Extract all entries in the archive to the supplied directory.
|
void |
extract(File target,
ExtractSpecification spec)
Extract the archive entries that match the supplied filter to the target
directory.
|
public ArchiveExtractor(Archive<?,?> archive)
archive
- The archive to extract contents from.public void extract(org.entityfs.DirectoryView target) throws org.entityfs.support.exception.WrappedIOException
target
- The target directory. If this is a view, all its view
settings will be ignored.org.entityfs.support.exception.WrappedIOException
- On I/O errors.public void extract(org.entityfs.DirectoryView target, ExtractSpecification spec) throws org.entityfs.support.exception.WrappedIOException
target
- The target directory. If this is a view, all its view
settings will be ignored.spec
- The specification object that contains configuration for this
extraction. ArchiveEntryFilter
.org.entityfs.support.exception.WrappedIOException
- On I/O errors.public void extract(File target) throws org.entityfs.support.exception.WrappedIOException, org.entityfs.exception.EntityNotFoundException, org.entityfs.exception.NotADirectoryException
target
- The target directory. This must be an existing directory.org.entityfs.support.exception.WrappedIOException
- On I/O errors.org.entityfs.exception.EntityNotFoundException
- If the target directory does not exist.org.entityfs.exception.NotADirectoryException
- If the target exists but is not a
directory.public void extract(File target, ExtractSpecification spec) throws org.entityfs.support.exception.WrappedIOException, org.entityfs.exception.EntityNotFoundException, org.entityfs.exception.NotADirectoryException
target
- The target directory. This must be an existing directory.spec
- The specification object that contains configuration for this
extraction.org.entityfs.support.exception.WrappedIOException
- On I/O errors.org.entityfs.exception.EntityNotFoundException
- If the target directory does not exist.org.entityfs.exception.NotADirectoryException
- If the target exists but is not a
directory.