List authPrefs = new ArrayList(2); authPrefs.add(AuthPolicy.DIGEST); authPrefs.add(AuthPolicy.BASIC);  client.getParams().setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs);
    private HttpClient getClient() {        HttpClient client = new HttpClient();        if (useProxy()) {            client.getHostConfiguration().setProxy(_proxyHost, _proxyPort);            if (useProxyAuthentication()) {                client.getState().setProxyCredentials(_proxyRealm, _proxyHost,                    new UsernamePasswordCredentials(_proxyUserName, _proxyPasswd));            }        }        if (useAuthentication()) {	        client.getState().setCredentials(	            _realm,	            _host,	            new UsernamePasswordCredentials(_userName, _passwd)	        );        }        return client;    }