Log4j 1.3alpha-8

org.apache.log4j.rolling.helper
Class ZipCompressAction

java.lang.Object
  |
  +--org.apache.log4j.rolling.helper.ActionBase
        |
        +--org.apache.log4j.rolling.helper.ZipCompressAction
All Implemented Interfaces:
Action, Runnable

public final class ZipCompressAction
extends ActionBase

Compresses a file using Zip compression.

Since:
1.3
Author:
Curt Arnold

Constructor Summary
ZipCompressAction(File source, File destination, boolean deleteSource, ULogger logger)
          Create new instance of GZCompressAction.
 
Method Summary
 boolean execute()
          Compress.
static boolean execute(File source, File destination, boolean deleteSource, ULogger logger)
          Compress a file.
protected  void reportException(Exception ex)
          Capture exception.
 
Methods inherited from class org.apache.log4j.rolling.helper.ActionBase
close, isComplete, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZipCompressAction

public ZipCompressAction(File source,
                         File destination,
                         boolean deleteSource,
                         ULogger logger)
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.
logger - logger, may be null.
Method Detail

execute

public boolean execute()
                throws IOException
Compress.
Overrides:
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,
                              ULogger logger)
                       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.
logger - logger, may be null.
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.

Log4j 1.3alpha-8

Copyright © 2000-2006 Apache Software Foundation.
Licensed under the Apache License, Version 2.0.