public final class GzCompressAction extends AbstractAction
LOGGER
Constructor and Description |
---|
GzCompressAction(File source,
File destination,
boolean deleteSource)
Deprecated.
|
GzCompressAction(File source,
File destination,
boolean deleteSource,
int compressionLevel)
Create new instance of GzCompressAction.
|
Modifier and Type | Method and Description |
---|---|
boolean |
execute()
Compress.
|
static boolean |
execute(File source,
File destination,
boolean deleteSource)
Deprecated.
In favor of
execute(File, File, boolean, int) . |
static boolean |
execute(File source,
File destination,
boolean deleteSource,
int compressionLevel)
Compress a file.
|
File |
getDestination() |
File |
getSource() |
boolean |
isDeleteSource() |
protected void |
reportException(Exception ex)
Capture exception.
|
String |
toString() |
close, isComplete, isInterrupted, run
public GzCompressAction(File source, 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(File source, File destination, boolean deleteSource)
GzCompressAction(File, File, boolean, int)
.public boolean execute() throws IOException
execute
in interface Action
execute
in class AbstractAction
IOException
- on IO exception.@Deprecated public static boolean execute(File source, File destination, boolean deleteSource) throws 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.IOException
- on IO exception.public static boolean execute(File source, File destination, boolean deleteSource, int compressionLevel) throws 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.IOException
- on IO exception.protected void reportException(Exception ex)
reportException
in class AbstractAction
ex
- exception.public File getSource()
public File getDestination()
public boolean isDeleteSource()
Copyright © 1999-2023 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.