}
}
void doCompression(boolean renameToTempFile, String nameOfFile2Compress,
String nameOfCompressedFile) throws RolloverFailure {
Compressor compressor = null;
if (renameToTempFile) {
String tmpTarget = nameOfFile2Compress + System.nanoTime() + ".tmp";
util.rename(getParentsRawFileProperty(), tmpTarget);
nameOfFile2Compress = tmpTarget;
}
switch (compressionMode) {
case GZ:
addInfo("GZIP compressing [" + nameOfFile2Compress + "].");
compressor = new Compressor(CompressionMode.GZ, nameOfFile2Compress,
nameOfCompressedFile);
compressor.setContext(this.context);
break;
case ZIP:
addInfo("ZIP compressing [" + nameOfFile2Compress + "]");
compressor = new Compressor(CompressionMode.ZIP, nameOfFile2Compress,
nameOfCompressedFile);
compressor.setContext(this.context);
break;
}
AsynchronousCompressor ac = new AsynchronousCompressor(compressor);
future = ac.compressAsynchronously();