try {
serverKey = CrawlServer.getServerKey(curi.getUURI());
} catch (URIException e) {
return false;
}
CrawlServer server = fetcher.getServerCache().getServerFor(serverKey);
if (server.hasCredentials()) {
for (Credential c: server.getCredentials()) {
if (c.isEveryTime()) {
if (c instanceof HttpAuthenticationCredential) {
HttpAuthenticationCredential cred = (HttpAuthenticationCredential) c;
AuthScheme authScheme = fetcher.chooseAuthScheme(server.getHttpAuthChallenges(), HttpHeaders.WWW_AUTHENTICATE);
populateHttpCredential(targetHost, authScheme, cred.getLogin(), cred.getPassword());
} else {
populateHtmlFormCredential((HtmlFormCredential) c);
}
}