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;h=2a52335e56f3d35473c58348512710edb3916ff8;hb=87ef46b7f3004e78b89c5a5c60d1160b332abbb2;hp=0ece5cab408d1c0a85037f17ebf3107a7791e40e;hpb=eff265962c081edb751d5d2ed99dc443cb97f3fb;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 0ece5cab4..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 @@ -3,6 +3,7 @@ * ONAP Policy Engine * ================================================================================ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Modified Copyright (C) 2018 Samsung Electronics Co., Ltd. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -297,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{