Rework more commons-lang usages (#10314)
* Reworks many commons-lang usages to use standard Java * Updates all remaining commons.lang imports to commons.lang3 Related to openhab/openhab-addons#7722 Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
@@ -18,7 +18,6 @@ import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.jetty.client.HttpClient;
|
||||
import org.eclipse.jetty.client.api.Authentication;
|
||||
import org.eclipse.jetty.client.api.AuthenticationStore;
|
||||
@@ -142,14 +141,17 @@ public class RobonectClient {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public URI getURI() {
|
||||
return this.uri;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(Request request) {
|
||||
request.header(this.header, this.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("Basic authentication result for %s", this.uri);
|
||||
}
|
||||
@@ -291,7 +293,7 @@ public class RobonectClient {
|
||||
String responseString = null;
|
||||
|
||||
// jetty uses UTF-8 as default encoding. However, HTTP 1.1 specifies ISO_8859_1
|
||||
if (StringUtils.isBlank(response.getEncoding())) {
|
||||
if (response.getEncoding() == null || response.getEncoding().isBlank()) {
|
||||
responseString = new String(response.getContent(), StandardCharsets.ISO_8859_1);
|
||||
} else {
|
||||
// currently v0.9e Robonect does not specifiy the encoding. But if later versions will
|
||||
|
||||
Reference in New Issue
Block a user