X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fadmin%2FPolicyRestController.java;fp=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fadmin%2FPolicyRestController.java;h=2a52335e56f3d35473c58348512710edb3916ff8;hb=87ef46b7f3004e78b89c5a5c60d1160b332abbb2;hp=b908c75d997e722151c5800465814902b088cd4b;hpb=5ad6783ca5a09c0061b661a48210f6d8e22cd7d3;p=policy%2Fengine.git diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyRestController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyRestController.java index b908c75d9..2a52335e5 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyRestController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyRestController.java @@ -298,15 +298,12 @@ public class PolicyRestController extends RestrictedBaseController{ Object obj = mapper1.treeToValue(root, Object.class); String json = mapper1.writeValueAsString(obj); - Object content = new ByteArrayInputStream(json.getBytes()); - - if (content instanceof InputStream) { - // send current configuration - try (OutputStream os = connection.getOutputStream()) { - int count = IOUtils.copy((InputStream) content, os); - if (policyLogger.isDebugEnabled()) { - policyLogger.debug("copied to output, bytes=" + count); - } + // send current configuration + try(InputStream content = new ByteArrayInputStream(json.getBytes()); + OutputStream os = connection.getOutputStream()) { + int count = IOUtils.copy(content, os); + if (policyLogger.isDebugEnabled()) { + policyLogger.debug("copied to output, bytes=" + count); } } }else{