public final class HttpClientUtils extends Object
Modifier and Type | Method and Description |
---|---|
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 fromeventLogger
- Copyright © 2018 Digipost. All rights reserved.