if (renameTo.endsWith(EXT_GZIP)) {
renameTo = renameTo.substring(0, renameTo.length() - EXT_GZIP.length());
compressAction = new GzCompressAction(new File(renameTo), new File(compressedName), true);
} else if (renameTo.endsWith(EXT_ZIP)) {
renameTo = renameTo.substring(0, renameTo.length() - EXT_ZIP.length());
compressAction = new ZipCompressAction(new File(renameTo), new File(compressedName), true,
compressionLevel);
}
final FileRenameAction renameAction =
new FileRenameAction(new File(currentFileName), new File(renameTo), false);