public void start() {
    util.setContext(this.context);

    if (fileNamePatternStr != null) {
      fileNamePattern = new FileNamePattern(fileNamePatternStr, this.context);
      determineCompressionMode();
    } else {
      addError(FNP_NOT_SET);
      addError(CoreConstants.SEE_FNP_NOT_SET);
      throw new IllegalStateException(FNP_NOT_SET + CoreConstants.SEE_FNP_NOT_SET);
    }

    if (isParentPrudent()) {
      addError("Prudent mode is not supported with FixedWindowRollingPolicy.");
      addError(PRUDENT_MODE_UNSUPPORTED);
      throw new IllegalStateException("Prudent mode is not supported.");
    }

    if (getParentsRawFileProperty() == null) {
      addError("The File name property must be set before using this rolling policy.");
      addError(SEE_PARENT_FN_NOT_SET);
      throw new IllegalStateException("The \"File\" option must be set.");
    }

    if (maxIndex < minIndex) {
      addWarn("MaxIndex (" + maxIndex + ") cannot be smaller than MinIndex (" + minIndex + ").");
      addWarn("Setting maxIndex to equal minIndex.");
      maxIndex = minIndex;
    }

    final int maxWindowSize = getMaxWindowSize();
    if ((maxIndex - minIndex) > maxWindowSize) {
      addWarn("Large window sizes are not allowed.");
      maxIndex = minIndex + maxWindowSize;
      addWarn("MaxIndex reduced to " + maxIndex);
    }

    IntegerTokenConverter itc = fileNamePattern.getIntegerTokenConverter();

    if (itc == null) {
      throw new IllegalStateException(
          "FileNamePattern ["
              + fileNamePattern.getPattern()
              + "] does not contain a valid IntegerToken");
    }

    if (compressionMode == CompressionMode.ZIP) {
      String zipEntryFileNamePatternStr = transformFileNamePatternFromInt2Date(fileNamePatternStr);
      zipEntryFileNamePattern = new FileNamePattern(zipEntryFileNamePatternStr, context);
    }
    compressor = new Compressor(compressionMode);
    compressor.setContext(this.context);
    super.start();
  }