Package org.apache.log4j.rolling.helper
Class ZipCompressAction
java.lang.Object
org.apache.log4j.rolling.helper.ActionBase
org.apache.log4j.rolling.helper.ZipCompressAction
Compresses a file using Zip compression.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionZipCompressAction
(File source, File destination, boolean deleteSource) Create new instance of GZCompressAction. -
Method Summary
Methods inherited from class org.apache.log4j.rolling.helper.ActionBase
close, isComplete, run
-
Field Details
-
source
Source file. -
destination
Destination file. -
deleteSource
private final boolean deleteSourceIf true, attempt to delete file on completion.
-
-
Constructor Details
-
ZipCompressAction
Create new instance of GZCompressAction.- Parameters:
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.
-
-
Method Details
-
execute
Compress.- Specified by:
execute
in interfaceAction
- Specified by:
execute
in classActionBase
- Returns:
- true if successfully compressed.
- Throws:
IOException
- on IO exception.
-
execute
public static boolean execute(File source, File destination, boolean deleteSource) throws IOException Compress a file.- Parameters:
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.- Returns:
- true if source file compressed.
- Throws:
IOException
- on IO exception.
-
reportException
Capture exception.- Overrides:
reportException
in classActionBase
- Parameters:
ex
- exception.
-