docs: private static void checkHttpResponseCodeValid(URLConnection connection) throws RepositoryHttpException, IOException {
          // if HTTP URL not File URL
          if (connection instanceof HttpURLConnection) {
              HttpURLConnection conn = (HttpURLConnection) connection;
              conn.setRequestMethod("GET");
              int respCode = conn.getResponseCode();
              if (respCode < 200 || respCode >= 300) {
                  throw new RepositoryHttpException("HTTP connection returned error code " + respCode, respCode, null);
              }
          }
      }