if (from.getUsername() != null) {
Builder credBuilder = LoginCredentials.builder().user(from.getUsername());
if (from.getCredentialUrl() != null) {
try {
credBuilder.credential(Strings2.toStringAndClose(slurp.apply(from.getCredentialUrl())));
} catch (IOException e) {
logger.error(e, "URI could not be read: %s", from.getCredentialUrl());
}
} else if (from.getCredential() != null) {
credBuilder.credential(from.getCredential());