Fix Java and Jetty deprecations (#10349)
Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
@@ -14,6 +14,7 @@ package org.openhab.binding.tacmi.internal.schema;
|
||||
|
||||
import java.net.URI;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -36,7 +37,6 @@ import org.eclipse.jetty.client.api.ContentResponse;
|
||||
import org.eclipse.jetty.client.api.Request;
|
||||
import org.eclipse.jetty.http.HttpHeader;
|
||||
import org.eclipse.jetty.http.HttpMethod;
|
||||
import org.eclipse.jetty.util.B64Code;
|
||||
import org.openhab.binding.tacmi.internal.TACmiChannelTypeProvider;
|
||||
import org.openhab.core.library.types.OnOffType;
|
||||
import org.openhab.core.library.types.StringType;
|
||||
@@ -109,8 +109,8 @@ public class TACmiSchemaHandler extends BaseThingHandler {
|
||||
this.online = false;
|
||||
updateStatus(ThingStatus.UNKNOWN);
|
||||
|
||||
this.authHeader = "Basic "
|
||||
+ B64Code.encode(config.username + ":" + config.password, StandardCharsets.ISO_8859_1);
|
||||
this.authHeader = "Basic " + Base64.getEncoder()
|
||||
.encodeToString((config.username + ":" + config.password).getBytes(StandardCharsets.ISO_8859_1));
|
||||
|
||||
final String serverBase = "http://" + config.host + "/";
|
||||
this.serverBase = serverBase;
|
||||
|
||||
Reference in New Issue
Block a user