public abstract class Compressor
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Class and Description |
---|---|
static class |
Compressor.Jar |
static class |
Compressor.Tar |
static class |
Compressor.Zip |
Modifier | Constructor and Description |
---|---|
protected |
Compressor() |
Modifier and Type | Method and Description |
---|---|
void |
addDirectory(java.io.File directory) |
void |
addDirectory(java.lang.String entryName) |
void |
addDirectory(java.lang.String prefix,
java.io.File directory) |
void |
addDirectory(java.lang.String entryName,
long timestamp) |
void |
addFile(java.lang.String entryName,
byte [] content) |
void |
addFile(java.lang.String entryName,
byte [] content,
long timestamp) |
void |
addFile(java.lang.String entryName,
java.io.File file) |
void |
addFile(java.lang.String entryName,
java.io.InputStream content) |
void |
addFile(java.lang.String entryName,
java.io.InputStream content,
long timestamp) |
Compressor |
filter(java.util.function.BiPredicate<java.lang.String,java.io.File> filter)
Allows filtering entries being added to the archive.
|
protected abstract void |
writeDirectoryEntry(java.lang.String name,
long timestamp) |
protected abstract void |
writeFileEntry(java.lang.String name,
java.io.InputStream source,
long length,
long timestamp) |
public Compressor filter(java.util.function.BiPredicate<java.lang.String,java.io.File> filter)
File
) could be null
when the filter is applied
to an entry not present on a disk - e.g. via addFile(String, byte[])
.public final void addFile(java.lang.String entryName, java.io.File file) throws java.io.IOException
java.io.IOException
public final void addFile(java.lang.String entryName, byte [] content) throws java.io.IOException
java.io.IOException
public final void addFile(java.lang.String entryName, byte [] content, long timestamp) throws java.io.IOException
java.io.IOException
public final void addFile(java.lang.String entryName, java.io.InputStream content) throws java.io.IOException
java.io.IOException
public final void addFile(java.lang.String entryName, java.io.InputStream content, long timestamp) throws java.io.IOException
java.io.IOException
public final void addDirectory(java.lang.String entryName) throws java.io.IOException
java.io.IOException
public final void addDirectory(java.lang.String entryName, long timestamp) throws java.io.IOException
java.io.IOException
public final void addDirectory(java.io.File directory) throws java.io.IOException
java.io.IOException
public final void addDirectory(java.lang.String prefix, java.io.File directory) throws java.io.IOException
java.io.IOException
protected abstract void writeDirectoryEntry(java.lang.String name, long timestamp) throws java.io.IOException
java.io.IOException
protected abstract void writeFileEntry(java.lang.String name, java.io.InputStream source, long length, long timestamp) throws java.io.IOException
java.io.IOException