From 6fd0f986be3292e46753049d741b966f0c9ebc55 Mon Sep 17 00:00:00 2001 From: Adhitya Kamakshidasan Date: Thu, 28 Jul 2016 21:56:57 +0530 Subject: Delete files from Server --- src/main/java/fossee/xcos/on/web/SciExec.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/main/java/fossee/xcos/on') diff --git a/src/main/java/fossee/xcos/on/web/SciExec.java b/src/main/java/fossee/xcos/on/web/SciExec.java index 994d1cd..2143ed8 100644 --- a/src/main/java/fossee/xcos/on/web/SciExec.java +++ b/src/main/java/fossee/xcos/on/web/SciExec.java @@ -37,6 +37,7 @@ public class SciExec extends GenericServlet { String imagePath = ""; String fileNameWithoutExt = ""; + String tempPath = ""; /** * Maverick: Ignore the following block. @@ -60,7 +61,7 @@ public class SciExec extends GenericServlet { IOUtils.copy(inputStream, outputStream); outputStream.close(); - String tempPath = xcosFile.getAbsolutePath(); + tempPath = xcosFile.getAbsolutePath(); String parentPath = xcosFile.getParent(); fileNameWithoutExt = FilenameUtils.removeExtension(xcosFile.getName()); @@ -123,5 +124,10 @@ public class SciExec extends GenericServlet { } in.close(); out.flush(); + + // Adhitya: Delete files after usage + new File(tempPath).delete(); + new File(imagePath).delete(); } + } -- cgit