Top Description Inners Fields Constructors Methods
ch.qos.logback.core.rolling.helper

public Class Compressor

extends ContextAwareBase
Class Inheritance
Imports
java.io.BufferedInputStream, .File, .FileInputStream, .FileOutputStream, java.util.concurrent.ExecutorService, .Future, java.util.zip.GZIPOutputStream, .ZipEntry, .ZipOutputStream, ch.qos.logback.core.rolling.RolloverFailure, ch.qos.logback.core.spi.ContextAwareBase, ch.qos.logback.core.status.ErrorStatus, .WarnStatus, ch.qos.logback.core.util.FileUtil

The Compression class implements ZIP and GZ file compression/decompression methods.
Author
Ceki Gülcü

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
pack-priv static final int
pack-priv final CompressionMode
Inherited from ch.qos.logback.core.spi.ContextAwareBase:
context

Constructor Summary

AccessConstructor and Description
public
Compressor(CompressionMode compressionMode)

Method Summary

Modifier and TypeMethod and Description
public Future<?>
asyncCompress(String nameOfFile2Compress, String nameOfCompressedFile, String innerEntryName)

public void
compress(String nameOfFile2Compress, String nameOfCompressedFile, String
The name of the file within the zip file. Use for ZIP compression.
innerEntryName
)

public static String
computeFileNameStrWithoutCompSuffix(String fileNamePatternStr, CompressionMode compressionMode)

pack-priv ZipEntry
computeZipEntry(File zippedFile)

pack-priv ZipEntry
pack-priv void
private void
gzCompress(String nameOfFile2gz, String nameOfgzedFile)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
private void
zipCompress(String nameOfFile2zip, String nameOfZippedFile, String innerEntryName)

Inherited from ch.qos.logback.core.spi.ContextAwareBase:
addErroraddErroraddInfoaddInfoaddStatusaddWarnaddWarngetContextgetDeclaredOrigingetStatusManagersetContext

Field Detail

BUFFER_SIZEback to summary
pack-priv static final int BUFFER_SIZE
compressionModeback to summary
pack-priv final CompressionMode compressionMode

Constructor Detail

Compressorback to summary
public Compressor(CompressionMode compressionMode)

Method Detail

asyncCompressback to summary
public Future<?> asyncCompress(String nameOfFile2Compress, String nameOfCompressedFile, String innerEntryName) throws RolloverFailure
compressback to summary
public void compress(String nameOfFile2Compress, String nameOfCompressedFile, String innerEntryName)
Parameters
innerEntryName:String

The name of the file within the zip file. Use for ZIP compression.

computeFileNameStrWithoutCompSuffixback to summary
public static String computeFileNameStrWithoutCompSuffix(String fileNamePatternStr, CompressionMode compressionMode)
computeZipEntryback to summary
pack-priv ZipEntry computeZipEntry(File zippedFile)
computeZipEntryback to summary
pack-priv ZipEntry computeZipEntry(String filename)
createMissingTargetDirsIfNecessaryback to summary
pack-priv void createMissingTargetDirsIfNecessary(File file)
gzCompressback to summary
private void gzCompress(String nameOfFile2gz, String nameOfgzedFile)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
zipCompressback to summary
private void zipCompress(String nameOfFile2zip, String nameOfZippedFile, String innerEntryName)
ch.qos.logback.core.rolling.helper back to summary

pack-priv Class Compressor.CompressionRunnable

extends Object
implements Runnable
Class Inheritance
  • java.lang.Object
  • ch.qos.logback.core.rolling.helper.Compressor.CompressionRunnable
All Implemented Interfaces
java.lang.Runnable

Field Summary

Modifier and TypeField and Description
pack-priv final String
pack-priv final String
pack-priv final String

Constructor Summary

AccessConstructor and Description
public
CompressionRunnable(String nameOfFile2Compress, String nameOfCompressedFile, String innerEntryName)

Method Summary

Modifier and TypeMethod and Description
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

innerEntryNameback to summary
pack-priv final String innerEntryName
nameOfCompressedFileback to summary
pack-priv final String nameOfCompressedFile
nameOfFile2Compressback to summary
pack-priv final String nameOfFile2Compress

Constructor Detail

CompressionRunnableback to summary
public CompressionRunnable(String nameOfFile2Compress, String nameOfCompressedFile, String innerEntryName)

Method Detail

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.