aboutsummaryrefslogtreecommitdiffstats
path: root/datarouter-node/src/main/java
diff options
context:
space:
mode:
authorFiachra Corcoran <fiachra.corcoran@ericsson.com>2018-10-17 16:08:38 +0100
committerFiachra Corcoran <fiachra.corcoran@ericsson.com>2018-10-17 16:12:29 +0100
commit1979daeb2b383b6a7bccda7c2f5dd7fe4bca612a (patch)
tree253e835bcbe9247ec119d5bb0844d89309723cb2 /datarouter-node/src/main/java
parent48d2152c0e6d2c547d1cd5aedd31425e1609e37d (diff)
Reverting changes from DMAAP-7753.0.1-ONAP3.0.0-ONAP1.0.3
Change-Id: If9fde76bbd606f40a67ff1181d08db25b0b563d7 Signed-off-by: Fiachra Corcoran <fiachra.corcoran@ericsson.com> Issue-ID: DMAAP-850
Diffstat (limited to 'datarouter-node/src/main/java')
-rw-r--r--datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java
index 26513358..a223b98c 100644
--- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java
+++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java
@@ -282,8 +282,9 @@ public class NodeServlet extends HttpServlet {
File data = new File(fbase);
File meta = new File(fbase + ".M");
OutputStream dos = null;
+ Writer mw = null;
InputStream is = null;
- try (Writer mw = new FileWriter(meta)) {
+ try {
StringBuffer mx = new StringBuffer();
mx.append(req.getMethod()).append('\t').append(fileid).append('\n');
Enumeration hnames = req.getHeaderNames();
@@ -357,10 +358,12 @@ public class NodeServlet extends HttpServlet {
}
String dbase = di.getSpool() + "/" + pubid;
Files.createLink(Paths.get(dbase), dpath);
+ mw = new FileWriter(meta);
mw.write(metadata);
if (di.getSubId() == null) {
mw.write("X-ATT-DR-ROUTING\t" + t.getRouting() + "\n");
}
+ mw.close();
meta.renameTo(new File(dbase + ".M"));
}
resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
@@ -385,6 +388,12 @@ public class NodeServlet extends HttpServlet {
} catch (Exception e) {
}
}
+ if (mw != null) {
+ try {
+ mw.close();
+ } catch (Exception e) {
+ }
+ }
try {
data.delete();
} catch (Exception e) {