public static final Pattern CONTAINER_KEY_PATH = Pattern.compile("^[/]?([^/]+)/(.*)$");
public void handleError(HttpCommand command, HttpResponse response) {
Exception exception = new HttpResponseException(command, response);
String message = null;
AzureStorageError error = null;
try {
if (response.getPayload() != null) {
String contentType = response.getPayload().getContentMetadata().getContentType();
if (contentType != null && (contentType.indexOf("xml") != -1 || contentType.indexOf("unknown") != -1)
&& !Long.valueOf(0).equals(response.getPayload().getContentMetadata().getContentLength())) {
try {
error = utils.parseAzureStorageErrorFromContent(command, response, response.getPayload().getInput());
if (error != null) {
message = error.getMessage();
exception = new AzureStorageResponseException(command, response, error);
}
} catch (RuntimeException e) {
try {
message = Strings2.toString(response.getPayload());