class PasswordUtils {

  public String readPassword(String passwordProperty, String defaultPassword) {
    if (StringUtils.isNotBlank(passwordProperty)) {
      if (CredentialProvider.isAliasString(passwordProperty)) {
        return readPasswordFromStore(passwordProperty);
      } else {
        final String pw = readPasswordFromFile(passwordProperty, defaultPassword);
        return CredentialProvider.isAliasString(pw) ? readPasswordFromStore(pw) : pw;
      }
    }
    return defaultPassword;
  }

  private  PasswordUtils();

}