rackspace/java-cloudfiles — Issue #36: ThreadSafeClientConnManager(params, schemeRegistry) is deprecated
Author: burtonrhodes
Created: 2012-02-18 15:44:07+00:00
State: open

Should consider changing ThreadSafeClientConnManager constructor to non-deprecated usage in com.rackspacecloud.client.cloudfiles.FilesClient (line 173):

```
this(new DefaultHttpClient() {
protected HttpParams createHttpParams() {
BasicHttpParams params = new BasicHttpParams();
org.apache.http.params.HttpConnectionParams.setSoTimeout(params, connectionTimeOut);
params.setParameter("http.socket.timeout", connectionTimeOut);
return params;
}

@Override
protected ClientConnectionManager createClientConnectionManager() {
SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(
new Scheme("http", 80, PlainSocketFactory.getSocketFactory()));
schemeRegistry.register(
new Scheme("https", 443, SSLSocketFactory.getSocketFactory()));
return new ThreadSafeClientConnManager(createHttpParams(), schemeRegistry);
}
}, username, password, authUrl, account, connectionTimeOut);

```

To this...

```
this(new DefaultHttpClient() {
@Override
protected ClientConnectionManager createClientConnectionManager() {
SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme("http", 80,
PlainSocketFactory.getSocketFactory()));
schemeRegistry.register(new Scheme("https", 443,
SSLSocketFactory.getSocketFactory()));
return new ThreadSafeClientConnManager(schemeRegistry);
}
}, username, password, authUrl, account, connectionTimeOut);

this.client.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, connectionTimeOut);
```