util.setLoggerRepository(this.repository);
compress.setLoggerRepository(this.repository);
// find out period from the filename pattern
if (fileNamePatternStr != null) {
fileNamePattern = new FileNamePattern(fileNamePatternStr);
fileNamePattern.setLoggerRepository(this.repository);
determineCompressionMode();
} else {
getLogger().warn(FNP_NOT_SET);
getLogger().warn(SEE_FNP_NOT_SET);
throw new IllegalStateException(FNP_NOT_SET + SEE_FNP_NOT_SET);
}
DateTokenConverter dtc = fileNamePattern.getDateTokenConverter();
if (dtc == null) {
throw new IllegalStateException(
"FileNamePattern [" + fileNamePattern.getPattern()
+ "] does not contain a valid DateToken");
}
int len = fileNamePatternStr.length();
switch(compressionMode) {
case Compress.GZ:
activeFileNamePattern =
new FileNamePattern(fileNamePatternStr.substring(0, len - 3));
break;
case Compress.ZIP:
activeFileNamePattern =
new FileNamePattern(fileNamePatternStr.substring(0, len - 4));
break;
case Compress.NONE:
activeFileNamePattern = fileNamePattern;
}
getLogger().info("Will use the pattern {} for the active file", activeFileNamePattern);