aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/core
diff options
context:
space:
mode:
authorMichael Dürre <michael.duerre@highstreet-technologies.com>2022-09-08 09:45:06 +0200
committerMichael Dürre <michael.duerre@highstreet-technologies.com>2022-09-08 09:46:47 +0200
commita2b6dd34d73bf432846dc59c6f57dd59a03aff9b (patch)
tree35658e382769bc7575f87d0e9580d6ee98230eb2 /sdnr/wt/odlux/core
parent6f9c3d2cea04a2af7a73d8df1de87d584b277552 (diff)
update odlux sources
update basic odlux functionality for kohn Issue-ID: CCSDK-3765 Signed-off-by: Michael Dürre <michael.duerre@highstreet-technologies.com> Change-Id: I3723c9c2f35b9012ba537920b294a54bb556cbc6 Signed-off-by: Michael Dürre <michael.duerre@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/odlux/core')
-rw-r--r--sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java20
1 files changed, 14 insertions, 6 deletions
diff --git a/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java b/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java
index a3f8dd7f6..c9d8a2d20 100644
--- a/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java
+++ b/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java
@@ -55,7 +55,12 @@ public class ResFilesServlet extends HttpServlet {
if(f.exists()) {
resp.setStatus(HttpURLConnection.HTTP_OK);
resp.setContentType("image/gif");
- Files.copy(f, resp.getOutputStream());
+ try {
+ Files.copy(f, resp.getOutputStream());
+ } catch (IOException e) {
+ LOG.warn("Can not copy data", e);
+ resp.setStatus(500);
+ }
return;
}
}
@@ -73,16 +78,19 @@ public class ResFilesServlet extends HttpServlet {
resp.setContentType(mimeType);
resp.setContentLength(length);
resp.setStatus(HttpURLConnection.HTTP_OK);
- OutputStream os = resp.getOutputStream();
- os.write(byteContent);
- os.flush();
- os.close();
+ try (OutputStream os = resp.getOutputStream()) {
+ os.write(byteContent);
+ os.flush();
+ } catch (IOException e) {
+ LOG.warn("Can not write data", e);
+ resp.setStatus(500);
+ }
} else {
LOG.debug("File {} not found in res.", fn);
resp.setStatus(HttpURLConnection.HTTP_NOT_FOUND);
}
} else {
- LOG.debug("BundleLoaderInstance to found.", fn);
+ LOG.debug("BundleLoaderInstance not found. {}", fn);
resp.setStatus(HttpURLConnection.HTTP_NOT_FOUND);
}
}