public abstract class Decompressor
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
Decompressor.Entry |
static class |
Decompressor.Tar
The Tar decompressor automatically detects the compression of an input file/stream.
|
static class |
Decompressor.Zip |
Modifier | Constructor and Description |
---|---|
protected |
Decompressor() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
closeEntryStream(java.io.InputStream stream) |
protected abstract void |
closeStream() |
static java.io.File |
entryFile(java.io.File outputDir,
java.lang.String entryName) |
void |
extract(java.io.File outputDir) |
Decompressor |
filter(Condition<? super java.lang.String> filter) |
protected abstract Decompressor.Entry |
nextEntry() |
protected abstract java.io.InputStream |
openEntryStream(Decompressor.Entry entry) |
protected abstract void |
openStream() |
Decompressor |
overwrite(boolean overwrite) |
Decompressor |
postprocessor(Consumer<? super java.io.File> consumer) |
Decompressor |
removePrefixPath(java.lang.String prefix)
Extracts only items whose paths starts with the normalized prefix of
prefix + '/' Paths are normalized before comparison. |
public Decompressor filter(Condition<? super java.lang.String> filter)
public Decompressor overwrite(boolean overwrite)
public Decompressor postprocessor(Consumer<? super java.io.File> consumer)
public Decompressor removePrefixPath(java.lang.String prefix) throws java.io.IOException
prefix + '/'
filter(Condition)
predicate is tested. overwrite(boolean)
to control it. prefix
- prefix to remove from every archive entry pathsjava.io.IOException
public final void extract(java.io.File outputDir) throws java.io.IOException
java.io.IOException
protected abstract void openStream() throws java.io.IOException
java.io.IOException
protected abstract Decompressor.Entry nextEntry() throws java.io.IOException
java.io.IOException
protected abstract java.io.InputStream openEntryStream(Decompressor.Entry entry) throws java.io.IOException
java.io.IOException
protected abstract void closeEntryStream(java.io.InputStream stream) throws java.io.IOException
java.io.IOException
protected abstract void closeStream() throws java.io.IOException
java.io.IOException
public static java.io.File entryFile(java.io.File outputDir, java.lang.String entryName) throws java.io.IOException
java.io.IOException