client = resource.retrieveSessionInstance();
HttpClientHandler handler = new HttpClientHandler();
int httpClientVersion = handler.getHttpClientMajorVersion();
if (httpClientVersion == 2) {
// VFS only supports httpclient v2 for now...
client.setHttpConnectionManager(new WebdavConnectionManager());
} else {
client.setHttpConnectionManager(new IvyWebdavConnectionManager());
}
} catch (final IOException e) {
throw new FileSystemException("vfs.provider.webdav/connect.error", hostname, e);