public void setup() { DefaultHttpClient defaultClient = new DefaultHttpClient(new PoolingClientConnectionManager(schemeRegistry), params); auth.setupConnection(defaultClient); if (enableGZip) { underlying.set(new DecompressingHttpClient(defaultClient)); } else { underlying.set(defaultClient); } }
@Bean public HttpClient httpClient() { DefaultHttpClient defaultHttpClient = new DefaultHttpClient(connectionManager()); HttpParams httpParams = defaultHttpClient.getParams(); HttpConnectionParams.setConnectionTimeout(httpParams, 2000); HttpConnectionParams.setSoTimeout(httpParams, 30000); return new DecompressingHttpClient(defaultHttpClient); }
ShellHttpClient() { this.httpClient = new DecompressingHttpClient(new DefaultHttpClient()); }