From 9e089401839b089b1127f67dda281679a148562e Mon Sep 17 00:00:00 2001
From: "Lange, Dr. Herbert" <herbert.lange@uni-hamburg.de>
Date: Mon, 4 Oct 2021 15:52:42 +0200
Subject: [PATCH] handle tmp as parameter for input and output when used
 locally

---
 .../de/uni_hamburg/corpora/server/CorpusChecker.java   | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/main/java/de/uni_hamburg/corpora/server/CorpusChecker.java b/src/main/java/de/uni_hamburg/corpora/server/CorpusChecker.java
index 12fc89b..c0c447a 100644
--- a/src/main/java/de/uni_hamburg/corpora/server/CorpusChecker.java
+++ b/src/main/java/de/uni_hamburg/corpora/server/CorpusChecker.java
@@ -45,9 +45,15 @@ class CorpusThread extends Thread {
     String callbackUrl; // URL to be called when the task is done, giving an empty string means skipping the callback
 
     CorpusThread(String infile, String outfile, String functions, String token, String callbackUrl) {
-        this.inFile = infile;
+        if (infile.equals("tmp"))
+            this.inFile = System.getProperty("java.io.tmpdir") + "/corpus-files";
+        else
+            this.inFile = infile;
         this.functionNames = functions ;
-        this.outFile = outfile;
+        if (outfile.equals("tmp"))
+          this.outFile = this.inFile + "/report.html";
+        else
+            this.outFile = outfile;
         this.token = token ;
         this.callbackUrl = callbackUrl ;
     }
-- 
GitLab