code: public void checkHttpURL(String document, String userAgent,
              ErrorHandler errorHandler)
              throws IOException, SAXException {
          CookieHandler.setDefault(
                  new CookieManager(null, CookiePolicy.ACCEPT_ALL));
          validator.reset();
          httpRes = new PrudentHttpEntityResolver(-1, true, errorHandler);
          if (this.allowCss) {
              httpRes.setAllowCss(true);
          }
          httpRes.setAllowHtml(true);
          httpRes.setUserAgent(userAgent);
          try {
              documentInput = (TypedInputSource) httpRes.resolveEntity(null,
                      document);
              String contentType = documentInput.getType();
              documentInput.setSystemId(document);
              for (String param : contentType.replace(" ", "").split(";")) {
                  if (param.startsWith("charset=")) {
                      documentInput.setEncoding(param.split("=", 2)[1]);
                      break;
                  }
              }
              if (documentInput.getType().startsWith("text/css")) {
                  checkAsCss(documentInput);
              } else if (documentInput.getType().startsWith("text/html")) {
                  checkAsHTML(documentInput);
              } else {
                  checkAsXML(documentInput);
              }
          } catch (ResourceNotRetrievableException e) {
          }
      }
docs: /* *
  Checks a Web document.
  
  @throws IOException if loading of the URL fails for some reason