private static @NotNull String fileNameFormatFromBaseFileNameAndDateFormat(final @NotNull String baseFileName,
                                                                    final @NotNull String dateFormat) {
    final String extension = FileUtilRt.getExtension(baseFileName);
    String unzippedExtension = "";
    String nameWithoutExtension = FileUtilRt.getNameWithoutExtension(baseFileName);

    if (extension.equals("gz")) {
      unzippedExtension = FileUtilRt.getExtension(nameWithoutExtension) + ".";
      nameWithoutExtension = FileUtilRt.getNameWithoutExtension(nameWithoutExtension);
    }

    return extension.isEmpty()
           ? nameWithoutExtension + ".{0,date," + dateFormat + "}"
           : nameWithoutExtension + ".{0,date," + dateFormat + "}." + unzippedExtension + extension;
  }
private static @NotNull String fileNameFormatFromBaseFileNameAndDateFormat(final @NotNull String baseFileName,
                                                                    final @NotNull String dateFormat)