public final class GzCompressAction extends AbstractAction
| Modifier and Type | Class and Description |
|---|---|
private static class |
GzCompressAction.ConfigurableLevelGZIPOutputStream |
| Modifier and Type | Field and Description |
|---|---|
private static int |
BUF_SIZE |
private int |
compressionLevel
GZIP compression level to use.
|
private boolean |
deleteSource
If true, attempt to delete file on completion.
|
private java.io.File |
destination
Destination file.
|
private java.io.File |
source
Source file.
|
LOGGER| Constructor and Description |
|---|
GzCompressAction(java.io.File source,
java.io.File destination,
boolean deleteSource)
Deprecated.
|
GzCompressAction(java.io.File source,
java.io.File destination,
boolean deleteSource,
int compressionLevel)
Create new instance of GzCompressAction.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
execute()
Compress.
|
static boolean |
execute(java.io.File source,
java.io.File destination,
boolean deleteSource)
Deprecated.
In favor of
execute(File, File, boolean, int). |
static boolean |
execute(java.io.File source,
java.io.File destination,
boolean deleteSource,
int compressionLevel)
Compress a file.
|
java.io.File |
getDestination() |
java.io.File |
getSource() |
boolean |
isDeleteSource() |
protected void |
reportException(java.lang.Exception ex)
Capture exception.
|
java.lang.String |
toString() |
close, isComplete, isInterrupted, runprivate static final int BUF_SIZE
private final java.io.File source
private final java.io.File destination
private final boolean deleteSource
private final int compressionLevel
Deflater.setLevel(int)public GzCompressAction(java.io.File source,
java.io.File destination,
boolean deleteSource,
int compressionLevel)
source - file to compress, may not be null.destination - compressed file, may not be null.deleteSource - if true, attempt to delete file on completion. Failure to delete
does not cause an exception to be thrown or affect return value.compressionLevel - Gzip deflater compression level.@Deprecated
public GzCompressAction(java.io.File source,
java.io.File destination,
boolean deleteSource)
GzCompressAction(File, File, boolean, int).public boolean execute()
throws java.io.IOException
execute in interface Actionexecute in class AbstractActionjava.io.IOException - on IO exception.@Deprecated
public static boolean execute(java.io.File source,
java.io.File destination,
boolean deleteSource)
throws java.io.IOException
execute(File, File, boolean, int).source - file to compress, may not be null.destination - compressed file, may not be null.deleteSource - if true, attempt to delete file on completion. Failure to delete
does not cause an exception to be thrown or affect return value.java.io.IOException - on IO exception.public static boolean execute(java.io.File source,
java.io.File destination,
boolean deleteSource,
int compressionLevel)
throws java.io.IOException
source - file to compress, may not be null.destination - compressed file, may not be null.deleteSource - if true, attempt to delete file on completion. Failure to delete
does not cause an exception to be thrown or affect return value.compressionLevel - Gzip deflater compression level.java.io.IOException - on IO exception.protected void reportException(java.lang.Exception ex)
reportException in class AbstractActionex - exception.public java.lang.String toString()
toString in class java.lang.Objectpublic java.io.File getSource()
public java.io.File getDestination()
public boolean isDeleteSource()