Code example for URI

Methods: getHost, getPort

0
		 
		if(preemptive) {
			httpClient.getParams().setAuthenticationPreemptive(true);
		} 
		httpClient.getState().setCredentials(
				new AuthScope(uri.getHost(), uri.getPort()),
				new UsernamePasswordCredentials(username, password));
	} 
	public void setUsername(String username) {
		this.username = username;
	} 
	public void setPassword(String password) {
		this.password = password;
	} 
	public void setPreemptive(boolean preemptive) {
		this.preemptive = preemptive;
	} 
}