final HttpComponentsClientHttpRequestFactory requestFactory;
final int timeout = env.getProperty("http.req.timeout", Integer.class);
if (env.getProperty("sec.auth.basic", Boolean.class)) {
final int port = env.getProperty(getPortPropertyName(), Integer.class);
final String host = env.getProperty(getHostPropertyName());
requestFactory = new PreemptiveAuthHttpRequestFactory(host, port, HttpHost.DEFAULT_SCHEME_NAME);
requestFactory.setReadTimeout(timeout);
} else {
requestFactory = new DigestHttpComponentsClientHttpRequestFactory() {
{
setReadTimeout(timeout);