public final class HttpResponseUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
checkResponse(org.apache.http.HttpResponse response,
EventLogger eventLogger) |
static boolean |
resourceAlreadyExists(org.apache.http.HttpResponse response) |
static boolean |
responseOk(org.apache.http.StatusLine status) |
static InputStream |
safelyOfferEntityStreamExternally(org.apache.http.client.methods.CloseableHttpResponse response,
EventLogger eventLogger)
Do proper resource handling in the case when offering the
stream from a http response
to a third party. |
public static InputStream safelyOfferEntityStreamExternally(org.apache.http.client.methods.CloseableHttpResponse response, EventLogger eventLogger)
stream
from a http response
to a third party. The third party must be expected to do proper resource handling on the received stream, but
in the case of any thrown exception when acquiring the stream, the 3rd party has no way of closing the resources
of the response, and thus must be handled by the method returning the stream.response
- the response to acquire the entity stream frompublic static boolean responseOk(org.apache.http.StatusLine status)
public static boolean resourceAlreadyExists(org.apache.http.HttpResponse response)
public static void checkResponse(org.apache.http.HttpResponse response, EventLogger eventLogger)
Copyright © 2019 Digipost. All rights reserved.