Fix Java and Jetty deprecations (#10349)

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born
2021-03-19 10:40:14 +01:00
committed by GitHub
parent 580f293766
commit fe0c35d22f
43 changed files with 98 additions and 80 deletions

View File

@@ -36,7 +36,6 @@ import org.eclipse.jetty.client.api.Request;
import org.eclipse.jetty.client.util.FutureResponseListener;
import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpMethod;
import org.eclipse.jetty.util.B64Code;
import org.openhab.binding.telegram.internal.TelegramHandler;
import org.openhab.core.automation.annotation.ActionInput;
import org.openhab.core.automation.annotation.RuleAction;
@@ -314,7 +313,8 @@ public class TelegramActions implements ThingActions {
AuthenticationStore auth = client.getAuthenticationStore();
URI uri = URI.create(photoURL);
auth.addAuthenticationResult(new BasicResult(HttpHeader.AUTHORIZATION, uri,
"Basic " + B64Code.encode(username + ":" + password, StandardCharsets.ISO_8859_1)));
"Basic " + Base64.getEncoder().encodeToString(
(username + ":" + password).getBytes(StandardCharsets.ISO_8859_1))));
}
try {
// API has 10mb limit to jpg file size, without this it can only accept 2mb