private InputStream getInputStream(HttpURLConnection connection) throws IOException, AmbariHttpException {
    int responseCode = connection.getResponseCode();
    if (responseCode >= ProxyService.HTTP_ERROR_RANGE_START) {
      String message = connection.getResponseMessage();
      if (connection.getErrorStream() != null) {
        message = IOUtils.toString(connection.getErrorStream());
      }
      LOG.error("Got error response for url {}. Response code:{}. {}", connection.getURL(), responseCode, message);
      throw new AmbariHttpException(message, responseCode);
    }
    return connection.getInputStream();
  }
Construct a view Ambari stream provider.

@param streamProvider        the underlying stream provider
@param ambariSessionManager  the Ambari session manager
@param controller         the Ambari configuration

@throws IllegalStateException if the Ambari stream provider can not be created
ambari-server/src/main/java/org/apache/ambari/server/view/ViewAmbariStreamProvider.java