From 8ea9951e1aa649efd5d9d01dfc68a1f3bcf8804f Mon Sep 17 00:00:00 2001 From: David Pilato Date: Thu, 31 Jul 2014 00:40:47 +0200 Subject: [PATCH] Replace 404 with HttpURLConnection.HTTP_NOT_FOUND --- .../cloud/azure/blobstore/AbstractAzureBlobContainer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/elasticsearch/cloud/azure/blobstore/AbstractAzureBlobContainer.java b/src/main/java/org/elasticsearch/cloud/azure/blobstore/AbstractAzureBlobContainer.java index 38e9bc95180..bf09f1e4845 100644 --- a/src/main/java/org/elasticsearch/cloud/azure/blobstore/AbstractAzureBlobContainer.java +++ b/src/main/java/org/elasticsearch/cloud/azure/blobstore/AbstractAzureBlobContainer.java @@ -33,6 +33,7 @@ import org.elasticsearch.common.logging.ESLoggerFactory; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; +import java.net.HttpURLConnection; import java.net.URISyntaxException; /** @@ -97,7 +98,7 @@ public class AbstractAzureBlobContainer extends AbstractBlobContainer { is.close(); listener.onCompleted(); } catch (ServiceException e) { - if (e.getHttpStatusCode() == 404) { + if (e.getHttpStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { listener.onFailure(new FileNotFoundException(e.getMessage())); } else { listener.onFailure(e);