private InputStream getInputStream(HttpURLConnection connection) throws IOException, AmbariHttpException {
    int responseCode = connection.getResponseCode();
    if(responseCode >= ProxyService.HTTP_ERROR_RANGE_START){
      throw new AmbariHttpException(IOUtils.toString(connection.getErrorStream()),responseCode);
    }
    return connection.getInputStream();
  }
Provider of an input stream for a request to the Remote Ambari server.
ambari-server/src/main/java/org/apache/ambari/server/view/RemoteAmbariStreamProvider.java