/
NikolayIvkin
/
tutorials1
Обзор
Документация
Войти
/
NikolayIvkin
/
tutorials1
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
apache-httpclient/src/test/java/com/baeldung/httpclient/ResponseUtil.java
26 строк
636 B
timis1
JAVA-26733 Upgrade wiremock to the latest version (#15206)
20 ноя 2023, 12:44
20 ноя 2023, 12:44
40315be
Код
Авторство
О чём код?
package com.baeldung.httpclient; import java.io.IOException; import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse; import org.apache.hc.core5.http.HttpEntity; public final class ResponseUtil { private ResponseUtil() { } public static void closeResponse(CloseableHttpResponse response) throws IOException { if (response == null) { return; } try { final HttpEntity entity = response.getEntity(); if (entity != null) { entity.getContent().close(); } } finally { response.close(); } } }