diff options
author | Amaresh Kumar <kamaresh@in.ibm.com> | 2018-09-07 15:04:21 +0530 |
---|---|---|
committer | Amaresh Kumar <kamaresh@in.ibm.com> | 2018-09-07 15:05:37 +0530 |
commit | 43cd454e7eb4e061cf79d84a9eda1b393a59edca (patch) | |
tree | 1ace3f0fc230d467c7da1f50040d5d8fc1f0ba60 /src | |
parent | b9862c6303212a98e18da3112c422a1cf4251ebf (diff) |
Fixed blocker issue in DMaaPResponseBuilder.java
https://sonar.onap.org/project/issues?id=org.onap.dmaap.messagerouter.msgrtr%3Amsgrtr&open=AWU41WfQwGn37JfbyHsq&resolved=false&severities=BLOCKER&types=BUG
Issue-ID: DMAAP-748
Change-Id: Ie21e69a8ff69aab20dcbd1ec0f6db947db55271a
Signed-off-by: Amaresh Kumar <kamaresh@in.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/att/dmf/mr/utils/DMaaPResponseBuilder.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/att/dmf/mr/utils/DMaaPResponseBuilder.java b/src/main/java/com/att/dmf/mr/utils/DMaaPResponseBuilder.java index 4c38d57..c9a998b 100644 --- a/src/main/java/com/att/dmf/mr/utils/DMaaPResponseBuilder.java +++ b/src/main/java/com/att/dmf/mr/utils/DMaaPResponseBuilder.java @@ -130,10 +130,10 @@ public class DMaaPResponseBuilder { */ public static void respondOkWithStream(DMaaPContext ctx, String mediaType, StreamWriter writer) throws IOException { ctx.getResponse().setStatus(200); - OutputStream os = getStreamForBinaryResponse(ctx, mediaType); - writer.write(os); - os.close(); - + try(OutputStream os = getStreamForBinaryResponse(ctx, mediaType)) { + writer.write(os); + } + } |