code: public RolloverDescription rollover(final String currentActiveFile) {
      long n = System.currentTimeMillis();
      nextCheck = ((n / 1000) + 1) * 1000;
  
      StringBuffer buf = new StringBuffer();
      formatFileName(new Date(n), buf);
  
      String newFileName = buf.toString();
  
      //
      //  if file names haven't changed, no rollover
      //
      if (newFileName.equals(lastFileName)) {
        return null;
      }
  
      Action renameAction = null;
      Action compressAction = null;
      String lastBaseName =
        lastFileName.substring(0, lastFileName.length() - suffixLength);
      String nextActiveFile =
        newFileName.substring(0, newFileName.length() - suffixLength);
  
      //
      //   if currentActiveFile is not lastBaseName then
      //        active file name is not following file pattern
      //        and requires a rename plus maintaining the same name
      if (!currentActiveFile.equals(lastBaseName)) {
        renameAction =
          new FileRenameAction(
            new File(currentActiveFile), new File(lastBaseName), true);
        nextActiveFile = currentActiveFile;
      }
  
      if (suffixLength == 3) {
        compressAction =
          new GZCompressAction(
            new File(lastBaseName), new File(lastFileName), true);
      }
  
      if (suffixLength == 4) {
        compressAction =
          new ZipCompressAction(
            new File(lastBaseName), new File(lastFileName), true);
      }
  
      lastFileName = newFileName;
  
      return new RolloverDescriptionImpl(
        nextActiveFile, false, renameAction, compressAction);
    }
docs: {@inheritDoc}