String repositoryProtocolString = node.getAttribute("repository-protocol", "http");
final Protocol protocol;
try {
protocol = Protocol.getProtocol(repositoryProtocolString);
} catch (IllegalStateException exception) {
throw new ConfigurationException("Unknown repository-protocol: " + repositoryProtocolString
+ ". Must be \"http\" or \"https\".", configuration);
}
String username = node.getAttribute("username", "");
String password = node.getAttribute("password", "");
final Credentials credentials = new UsernamePasswordCredentials(username, password);