uk.org.simonsite.log4j.appender
Class GzipFileCompressionStrategy

java.lang.Object
  extended by uk.org.simonsite.log4j.appender.LogFileCompressionStrategy
      extended by uk.org.simonsite.log4j.appender.GzipFileCompressionStrategy

final class GzipFileCompressionStrategy
extends LogFileCompressionStrategy

Version:
2.1
Author:
Simon Park, Oleksiy Pastukhov

Field Summary
 
Fields inherited from class uk.org.simonsite.log4j.appender.LogFileCompressionStrategy
DEFAULT, GZIP, ZIP
 
Constructor Summary
GzipFileCompressionStrategy()
           
 
Method Summary
(package private)  boolean compress(File backupFile, File deflatedFile, AppenderRollingProperties properties)
          Compress the backup file as per the implemented algorithm.
(package private)  String getAlgorithmName()
           
(package private)  boolean isCompressed(File backupFile)
           
 
Methods inherited from class uk.org.simonsite.log4j.appender.LogFileCompressionStrategy
compress, existsFor, findCompressionStrategy, isRequiredStrategy, strategies
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GzipFileCompressionStrategy

GzipFileCompressionStrategy()
Method Detail

getAlgorithmName

final String getAlgorithmName()
Specified by:
getAlgorithmName in class LogFileCompressionStrategy
Returns:
The name to be used in the suffix of the compressed file.

isCompressed

final boolean isCompressed(File backupFile)
Specified by:
isCompressed in class LogFileCompressionStrategy

compress

final boolean compress(File backupFile,
                       File deflatedFile,
                       AppenderRollingProperties properties)
Description copied from class: LogFileCompressionStrategy
Compress the backup file as per the implemented algorithm.

Specified by:
compress in class LogFileCompressionStrategy
Parameters:
backupFile - The file to be compressed.
deflatedFile - The target file to which the compressed stream will be written.
properties - The appender's configuration.
Returns:
true if compression was successful