| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static void | closeQuietly(final HttpResponse
the HttpResponse to release resources, may be null or already
closed. response)Unconditionally close a response. |
| public static void | closeQuietly(final CloseableHttpResponse
the HttpResponse to release resources, may be null or already
closed. response)Unconditionally close a response. |
| public static void | closeQuietly(final HttpClient
the HttpClient to close, may be null or already closed. httpClient)Unconditionally close a httpClient. |
| HttpClientUtils | back to summary |
|---|---|
| private HttpClientUtils() | |
| closeQuietly | back to summary |
|---|---|
| public static void closeQuietly(final HttpResponse response) Unconditionally close a response. Example Code:
HttpResponse httpResponse = null;
try {
httpResponse = httpClient.execute(httpGet);
} catch (Exception e) {
// error handling
} finally {
HttpClientUtils.closeQuietly(httpResponse);
}
| |
| closeQuietly | back to summary |
|---|---|
| public static void closeQuietly(final CloseableHttpResponse response) Unconditionally close a response. Example Code:
HttpResponse httpResponse = null;
try {
httpResponse = httpClient.execute(httpGet);
} catch (Exception e) {
// error handling
} finally {
HttpClientUtils.closeQuietly(httpResponse);
}
| |
| closeQuietly | back to summary |
|---|---|
| public static void closeQuietly(final HttpClient httpClient) Unconditionally close a httpClient. Shuts down the underlying connection manager and releases the resources. Example Code:
HttpClient httpClient = HttpClients.createDefault();
try {
httpClient.execute(request);
} catch (Exception e) {
// error handling
} finally {
HttpClientUtils.closeQuietly(httpClient);
}
| |