|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.x4juli.global.components.AbstractComponent
org.x4juli.handlers.rolling.helper.AbstractAction
org.x4juli.handlers.rolling.helper.ZipCompressAction
Compresses a file using Zip compression.
Logging API as a whole was originally done for Apache log4j. Juli is a port of main parts of that to complete the Java Logging APIs. All credits for initial idea, design, implementation, documentation belong to the log4j crew. This file was originally published by Curt Arnold. Please use exclusively the appropriate mailing lists for questions, remarks and contribution.
| Field Summary | |
private boolean |
deleteSource
If true, attempt to delete file on completion. |
private java.io.File |
destination
Destination file. |
private java.io.File |
source
Source file. |
| Fields inherited from class org.x4juli.handlers.rolling.helper.AbstractAction |
|
| Fields inherited from class org.x4juli.global.components.AbstractComponent |
manager, repository |
| Constructor Summary | |
ZipCompressAction(java.io.File source,
java.io.File destination,
boolean deleteSource)
Create new instance of GZCompressAction. |
|
| Method Summary | |
boolean |
execute()
Perform action. |
static boolean |
execute(java.io.File source,
java.io.File destination,
boolean deleteSource,
ExtendedLogger logger)
Compress a file. |
protected void |
reportException(java.lang.Exception ex)
Capture exception. |
| Methods inherited from class org.x4juli.handlers.rolling.helper.AbstractAction |
close, isComplete, run |
| Methods inherited from class org.x4juli.global.components.AbstractComponent |
getLogger, getLoggerRepository, getMessageProperties, getNonFloodingLogger, getProperty, getProperty, getProperty, getProperty, resetErrorCount, setObjectStore |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private final java.io.File source
private final java.io.File destination
private final boolean deleteSource
| Constructor Detail |
public ZipCompressAction(java.io.File source,
java.io.File destination,
boolean deleteSource)
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 Detail |
public boolean execute()
throws java.io.IOException
execute in interface Actionexecute in class AbstractActionjava.io.IOException - if IO error.
public static boolean execute(java.io.File source,
java.io.File destination,
boolean deleteSource,
ExtendedLogger logger)
throws java.io.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.
java.io.IOException - on IO exception.protected void reportException(java.lang.Exception ex)
reportException in class AbstractActionex - exception.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||