From 1352168d5e0ba436523a3daa31a15128bc0ffa63 Mon Sep 17 00:00:00 2001 From: Rajitha Kumara Date: Wed, 19 Jun 2024 11:46:28 +0530 Subject: [PATCH] Change method names into meaningfull names --- .../mgt/core/ui/request/interceptor/util/HandlerUtil.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/util/HandlerUtil.java b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/util/HandlerUtil.java index 8c0d0b4064..26c4be4201 100644 --- a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/util/HandlerUtil.java +++ b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/util/HandlerUtil.java @@ -112,7 +112,7 @@ public class HandlerUtil { HandlerConstants.INTERNAL_ERROR_CODE)); return handlerResponse; } - JsonNode responseData = getResponseData(responseEntity); + JsonNode responseData = getResponseDataAsJsonNode(responseEntity); if (statusCode == HttpStatus.SC_OK || statusCode == HttpStatus.SC_CREATED) { handlerResponse.setCode(statusCode); handlerResponse.setData(responseData); @@ -756,12 +756,12 @@ public class HandlerUtil { * @return {@link JsonNode} consists with response data content * @throws IOException Throws when IO exception encountered */ - public static JsonNode getResponseData(HttpEntity responseEntity) throws IOException { + public static JsonNode getResponseDataAsJsonNode(HttpEntity responseEntity) throws IOException { JsonFactory jsonFactory = new JsonFactory(); ObjectMapper objectMapper = new ObjectMapper(jsonFactory); JsonNode finalNode; try (InputStream inputStream = responseEntity.getContent()) { - String content = getResponseAsString(inputStream); + String content = getResponseDataAsString(inputStream); try { finalNode = objectMapper.readTree(content); } catch (JsonProcessingException e) { @@ -779,7 +779,7 @@ public class HandlerUtil { * @return String content of the incoming response * @throws IOException Throws when IO exception encountered */ - public static String getResponseAsString(InputStream inputStream) throws IOException { + public static String getResponseDataAsString(InputStream inputStream) throws IOException { char []buffer = new char[8192]; StringBuilder stringBuilder = new StringBuilder(); try (Reader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) {