* @param host the host the realm is on
* @return the credentials
*
*/
private static Credentials matchCredentials(HashMap map, String realm, String host) {
HttpAuthRealm entry = new HttpAuthRealm(host, realm);
Credentials creds = (Credentials) map.get(entry);
if (creds == null && host != null && realm != null) {
entry = new HttpAuthRealm(host, null);
creds = (Credentials) map.get(entry);
if (creds == null) {
entry = new HttpAuthRealm(null, realm);
creds = (Credentials) map.get(entry);
}
}
if (creds == null) {
creds = (Credentials) map.get(DEFAULT_AUTH_REALM);