public static boolean downloadAtomically(@Nullable ProgressIndicator indicator,
                                           @NotNull String url,
                                           @NotNull File outputFile,
                                           @NotNull File tempFile,
                                           @Nullable Predicate<? super String> contentChecker) throws IOException {
    try {
      downloadContentToFile(indicator, url, tempFile);
      if (contentChecker != null) {
        String content = FileUtil.loadFile(tempFile);
        if (!contentChecker.test(content)) {
          return false;
        }
      }
      FileUtil.rename(tempFile, outputFile);
      return true;
    }
    finally {
      FileUtil.delete(tempFile);
    }
  }
public static boolean downloadAtomically(@Nullable ProgressIndicator indicator,
                                           @NotNull String url,
                                           @NotNull File outputFile,
                                           @NotNull File tempFile,
                                           @Nullable Predicate<? super String> contentChecker)