summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRam Koya <rk541m@att.com>2018-09-07 15:22:23 +0000
committerGerrit Code Review <gerrit@onap.org>2018-09-07 15:22:23 +0000
commitb1a2963af584d1baed00695d2d8147338141fc53 (patch)
tree284a026f3f58c19091995d7edea841c6d393de67
parent7e47dcf3f89e77d993620e50d0364772decfb211 (diff)
parent43cd454e7eb4e061cf79d84a9eda1b393a59edca (diff)
Merge "Fixed blocker issue in DMaaPResponseBuilder.java"
-rw-r--r--src/main/java/com/att/dmf/mr/utils/DMaaPResponseBuilder.java8
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);
+ }
+
}