MobileLedgerProfile profile = Data.profile.get();
final String backend_url = profile.getUrl();
final boolean use_auth = profile.isAuthEnabled();
MobileLedgerProfile profile = Data.profile.get();
final String backend_url = profile.getUrl();
final boolean use_auth = profile.isAuthEnabled();
if (use_auth) {
final String auth_user = profile.getAuthUserName();
final String auth_password = profile.getAuthPassword();
if (use_auth) {
final String auth_user = profile.getAuthUserName();
final String auth_password = profile.getAuthPassword();
- final byte[] bytes =
- (String.format("%s:%s", auth_user, auth_password)).getBytes("UTF-8");
+ final byte[] bytes = (String.format("%s:%s", auth_user, auth_password))
+ .getBytes(StandardCharsets.UTF_8);
final String value = Base64.encodeToString(bytes, Base64.DEFAULT);
http.setRequestProperty("Authorization", "Basic " + value);
}
final String value = Base64.encodeToString(bytes, Base64.DEFAULT);
http.setRequestProperty("Authorization", "Basic " + value);
}