code: private InputStream getInputStream(String url) throws Exception {
          HttpGet getMethod = new HttpGet(url);
          DefaultHttpClient client = new DefaultHttpClient(m_cManager);
          client.getParams().setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, TIMEOUT_SECONDS * 1000);
          UsernamePasswordCredentials creds = getCreds(url);
          if (creds != null) {
              client.getCredentialsProvider().setCredentials(AuthScope.ANY, creds);
              client.addRequestInterceptor(new PreemptiveAuth());
          }
          client.getParams().setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, true);
          HttpInputStream in = new HttpInputStream(client, getMethod);
          if (in.getStatusCode() != 200) {
              try {
                  in.close();
              } catch (Exception e) {
              }
              throw new IOException("HTTP request failed.  Got status code "
                      + in.getStatusCode()
                      + " from remote server while attempting to GET " + url);
          } else {
              return in;
          }
      }
docs: Get the content at the given location using the configured credentials
  (if any).