public final class CommonsCompressAction extends AbstractAction
LOGGER
Constructor and Description |
---|
CommonsCompressAction(String name,
File source,
File destination,
boolean deleteSource)
Creates new instance of Bzip2CompressAction.
|
Modifier and Type | Method and Description |
---|---|
boolean |
execute()
Compresses.
|
static boolean |
execute(String name,
File source,
File destination,
boolean deleteSource)
Compresses a file.
|
File |
getDestination() |
String |
getName() |
File |
getSource() |
boolean |
isDeleteSource() |
protected void |
reportException(Exception ex)
Reports exception.
|
String |
toString() |
close, isComplete, isInterrupted, run
public CommonsCompressAction(String name, File source, File destination, boolean deleteSource)
name
- the compressor name. One of "gz", "bzip2", "xz", "pack200", or "deflate".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.public boolean execute() throws IOException
execute
in interface Action
execute
in class AbstractAction
IOException
- on IO exception.public static boolean execute(String name, File source, File destination, boolean deleteSource) throws IOException
name
- the compressor name, i.e. "gz", "bzip2", "xz", "pack200", or "deflate".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.protected void reportException(Exception ex)
reportException
in class AbstractAction
ex
- exception.public File getDestination()
public boolean isDeleteSource()
Copyright © 1999-2019 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.