You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ga...@apache.org on 2019/08/08 19:00:14 UTC
[jclouds] branch 2.1.x updated: Use Guava Charsets with 2.1.x which
supports JDK 6
This is an automated email from the ASF dual-hosted git repository.
gaul pushed a commit to branch 2.1.x
in repository https://gitbox.apache.org/repos/asf/jclouds.git
The following commit(s) were added to refs/heads/2.1.x by this push:
new 130c0df Use Guava Charsets with 2.1.x which supports JDK 6
130c0df is described below
commit 130c0df5ce1a67d60b53a22973f1d649a3759a4b
Author: Andrew Gaul <ga...@apache.org>
AuthorDate: Thu Aug 8 11:59:22 2019 -0700
Use Guava Charsets with 2.1.x which supports JDK 6
---
.../java/org/jclouds/aws/handlers/ParseAWSErrorFromXmlContent.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/apis/sts/src/main/java/org/jclouds/aws/handlers/ParseAWSErrorFromXmlContent.java b/apis/sts/src/main/java/org/jclouds/aws/handlers/ParseAWSErrorFromXmlContent.java
index 2ebe0d3..263cabf 100644
--- a/apis/sts/src/main/java/org/jclouds/aws/handlers/ParseAWSErrorFromXmlContent.java
+++ b/apis/sts/src/main/java/org/jclouds/aws/handlers/ParseAWSErrorFromXmlContent.java
@@ -20,7 +20,6 @@ import static org.jclouds.http.HttpUtils.closeClientButKeepContentStream;
import static org.jclouds.http.HttpUtils.releasePayload;
import java.io.IOException;
-import java.nio.charset.StandardCharsets;
import javax.annotation.Resource;
import javax.inject.Inject;
@@ -41,6 +40,7 @@ import org.jclouds.rest.ResourceNotFoundException;
import org.jclouds.util.Strings2;
import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Charsets;
/**
* This will parse and set an appropriate exception on the command object.
@@ -66,7 +66,7 @@ public class ParseAWSErrorFromXmlContent implements HttpErrorHandler {
AWSError error = null;
// it is important to always read fully and close streams
byte[] data = closeClientButKeepContentStream(response);
- String message = data != null ? new String(data, StandardCharsets.UTF_8) : null;
+ String message = data != null ? new String(data, Charsets.UTF_8) : null;
if (response.getPayload() != null) {
String contentType = response.getPayload().getContentMetadata().getContentType();
if (contentType != null && (contentType.indexOf("xml") != -1 || contentType.indexOf("unknown") != -1)) {