private static @Nullable FetchResult fetchData(final Project project, final String dtdUrl, final ProgressIndicator indicator) throws IOException {
    try {
      return HttpRequests.request(dtdUrl).accept("text/xml,application/xml,text/html,*/*").connect(request -> {
        FetchResult result = new FetchResult();
        result.bytes = request.readBytes(indicator);
        result.contentType = request.getConnection().getContentType();
        return result;
      });
    }
    catch (MalformedURLException e) {
      if (!ApplicationManager.getApplication().isUnitTestMode()) {
        ApplicationManager.getApplication().invokeLater(() -> Messages.showMessageDialog(project,
                                                                                       XmlBundle.message(
                                                                                         "xml.intention.fetch.error.invalid.url.message", dtdUrl),
                                                                                       XmlBundle.message(
                                                                                         "xml.intention.fetch.error.invalid.url.title"),
                                                                                       Messages.getErrorIcon()), indicator.getModalityState());
      }
    }

    return null;
  }
private static @Nullable FetchResult fetchData(final Project project, final String dtdUrl, final ProgressIndicator indicator)