Skip to content

Commit

Permalink
Resolves #15 - CredentialsUtil is able to create Credentials from Str…
Browse files Browse the repository at this point in the history
…ing params
  • Loading branch information
sfloess committed Sep 3, 2024
1 parent 595a2e4 commit f333d9e
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public final class CredentialsUtil {
*/
private static final Logger LOGGER = Logger.getLogger(CredentialsUtil.class.getName());


/**
* Return the logger.
*
Expand All @@ -33,10 +32,14 @@ static Logger getLogger() {
private CredentialsUtil() {
}

public static Credentials fromValues(final String url, final String username, final String password, final String token, final String version) {
return new CredentialsRecord(url, username, password, token, version);
}

public static Credentials fromProperties(final Properties properties) {
Objects.requireNonNull(properties, "Null properties not allowed!");

return new CredentialsRecord(
return fromValues(
PropertiesCredentialsEnum.URL.getValue(properties),
PropertiesCredentialsEnum.USERNAME.getValue(properties),
PropertiesCredentialsEnum.PASSWORD.getValue(properties),
Expand Down

0 comments on commit f333d9e

Please sign in to comment.