Source:
<code>public HttpClientRequestExecutor(ApiKey apiKey, Proxy proxy, AuthenticationScheme authenticationScheme) { Assert.notNull(apiKey, "apiKey argument is required."); this.apiKey = apiKey; <START> if(authenticationScheme != null) { <END> switch (authenticationScheme) { case Basic: this.requestAuthenticator = new BasicAuthenticationRequestAuthenticator(); break; case SAuthc1: this.requestAuthenticator = new Sauthc1RequestAuthenticator(); break; default: this.requestAuthenticator = new Sauthc1RequestAuthenticator(); break; } } else{ this.requestAuthenticator = new Sauthc1RequestAuthenticator(); } this.httpClientRequestFactory = new HttpClientRequestFactory(); PoolingClientConnectionManager connMgr = new PoolingClientConnectionManager(); connMgr.setDefaultMaxPerRoute(10); this.httpClient = new DefaultHttpClient(connMgr); httpClient.getParams().setParameter(AllClientPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1); httpClient.getParams().setParameter(AllClientPNames.SO_TIMEOUT, CONNECTION_TIMEOUT); httpClient.getParams().setParameter(AllClientPNames.CONNECTION_TIMEOUT, CONNECTION_TIMEOUT); httpClient.getParams().setParameter(ClientPNames.HANDLE_REDIRECTS, false); httpClient.getParams().setParameter("http.protocol.content-charset", "UTF-8"); if (proxy != null) { HttpHost httpProxyHost = new HttpHost(proxy.getHost(), proxy.getPort()); httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, httpProxyHost); if (proxy.isAuthenticationRequired()) { httpClient.getCredentialsProvider().setCredentials( new AuthScope(proxy.getHost(), proxy.getPort()), new UsernamePasswordCredentials(proxy.getUsername(), proxy.getPassword())); } } }</code><technical_language>do: java this.requestAuthenticator = requestAuthenticatorFactory.create(authenticationScheme); This is, of course, added factory a property of class: java private RequestAuthenticatorFactory requestAuthenticatorFactory = new DefaultRequestAuthenticatorFactory();</technical_language>

Target:
public HttpClientRequestExecutor(ApiKey apiKey, Proxy proxy, AuthenticationScheme authenticationScheme) { Assert.notNull(apiKey, "apiKey argument is required."); this.apiKey = apiKey; this.requestAuthenticator = requestAuthenticatorFactory.create(authenticationScheme); this.httpClientRequestFactory = new HttpClientRequestFactory(); PoolingClientConnectionManager connMgr = new PoolingClientConnectionManager(); connMgr.setDefaultMaxPerRoute(10); this.httpClient = new DefaultHttpClient(connMgr); httpClient.getParams().setParameter(AllClientPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1); httpClient.getParams().setParameter(AllClientPNames.SO_TIMEOUT, CONNECTION_TIMEOUT); httpClient.getParams().setParameter(AllClientPNames.CONNECTION_TIMEOUT, CONNECTION_TIMEOUT); httpClient.getParams().setParameter(ClientPNames.HANDLE_REDIRECTS, false); httpClient.getParams().setParameter("http.protocol.content-charset", "UTF-8"); if (proxy != null) { HttpHost httpProxyHost = new HttpHost(proxy.getHost(), proxy.getPort()); httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, httpProxyHost); if (proxy.isAuthenticationRequired()) { httpClient.getCredentialsProvider().setCredentials( new AuthScope(proxy.getHost(), proxy.getPort()), new UsernamePasswordCredentials(proxy.getUsername(), proxy.getPassword())); } } }