Replace 404 with HttpURLConnection.HTTP_NOT_FOUND

This commit is contained in:
David Pilato 2014-07-31 00:40:47 +02:00
parent 248845638a
commit 8ea9951e1a
1 changed files with 2 additions and 1 deletions

View File

@ -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);