for( AuthenticationInfo authentication : authentications ) {
ClientFilter filter = null;
if( authentication.getType().equals( AuthenticationType.BASIC ) ) {
filter = new HTTPBasicAuthFilter( authentication.getUser(), authentication.getPassword() );
} else if( authentication.getType().equals( AuthenticationType.DIGEST ) ) {
filter = new HTTPDigestAuthFilter( authentication.getUser(), authentication.getPassword() );
}
client.addFilter( filter );
}
}