summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAdhitya Kamakshidasan2016-07-28 21:56:57 +0530
committerAdhitya Kamakshidasan2016-07-28 21:56:57 +0530
commit6fd0f986be3292e46753049d741b966f0c9ebc55 (patch)
treecb46b57a698c9b521f6674e11624ae2b7eff580e /src/main
parent572f2fef124c7e62afb917ef9c596a22724da077 (diff)
downloadxcos-on-web-6fd0f986be3292e46753049d741b966f0c9ebc55.tar.gz
xcos-on-web-6fd0f986be3292e46753049d741b966f0c9ebc55.tar.bz2
xcos-on-web-6fd0f986be3292e46753049d741b966f0c9ebc55.zip
Delete files from Server
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/fossee/xcos/on/web/SciExec.java8
1 files changed, 7 insertions, 1 deletions
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();
}
+
}