port = 443;
else
port = 80;
}
AuthScope scope = new AuthScope(url.getHost(), port);
if (client.getState().getCredentials(scope) != null) {
if (LOG.isTraceEnabled())
LOG.trace("Pre-configured credentials with scope - host: "
+ url.getHost() + "; port: " + port
+ "; found for url: " + url);
// Credentials are already configured, so do nothing and return
return;
}
if (LOG.isTraceEnabled())
LOG.trace("Pre-configured credentials with scope - host: "
+ url.getHost() + "; port: " + port
+ "; not found for url: " + url);
AuthScope serverAuthScope = getAuthScope(
url.getHost(), port, defaultRealm, defaultScheme);
NTCredentials serverCredentials = new NTCredentials(
defaultUsername, defaultPassword,
agentHost, defaultRealm);