// set the LR for our utility object
util.setContext(this.context);
// find out period from the filename pattern
if (fileNamePatternStr != null) {
fileNamePattern = new FileNamePattern(fileNamePatternStr, this.context);
determineCompressionMode();
} else {
addWarn(FNP_NOT_SET);
addWarn(CoreConstants.SEE_FNP_NOT_SET);
throw new IllegalStateException(FNP_NOT_SET + CoreConstants.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 GZ:
activeFileNamePattern = new FileNamePattern(fileNamePatternStr.substring(
0, len - 3), this.context);
break;
case ZIP:
activeFileNamePattern = new FileNamePattern(fileNamePatternStr.substring(
0, len - 4), this.context);
break;
case NONE:
activeFileNamePattern = fileNamePattern;
}