org.apache.logging.log4j.core.appender.rolling.helper
Class GZCompressAction
java.lang.Object
org.apache.logging.log4j.core.appender.rolling.helper.ActionBase
org.apache.logging.log4j.core.appender.rolling.helper.GZCompressAction
- All Implemented Interfaces:
- Runnable, Action
public final class GZCompressAction
- extends ActionBase
Compresses a file using GZ compression.
Fields inherited from class org.apache.logging.log4j.core.appender.rolling.helper.ActionBase |
LOGGER |
Constructor Summary |
GZCompressAction(File source,
File destination,
boolean deleteSource)
Create new instance of GZCompressAction. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GZCompressAction
public GZCompressAction(File source,
File destination,
boolean deleteSource)
- 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.
execute
public boolean execute()
throws IOException
- Compress.
- Specified by:
execute
in interface Action
- Specified by:
execute
in class ActionBase
- 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
protected void reportException(Exception ex)
- Capture exception.
- Overrides:
reportException
in class ActionBase
- Parameters:
ex
- exception.
Copyright © 1999-2012 Apache Software Foundation. All Rights Reserved.