code: private void setPreemptiveAuth(FedoraHttpClient httpClient) {
          this.localContext = new BasicHttpContext();
          BasicScheme basicAuth = new BasicScheme();
          localContext.setAttribute("preemptive-auth", basicAuth);
          httpClient.addRequestInterceptor(new PreemptiveAuthInterceptor(), 0);
      }
docs: http://stackoverflow.com/questions/2014700/preemptive-basic-authentication-with-apache-httpclient-4