From f3851da485aa1a83a652a81458a288fc35d7d3b2 Mon Sep 17 00:00:00 2001
From: Timm Fitschen <t.fitschen@indiscale.com>
Date: Fri, 19 Mar 2021 17:04:01 +0100
Subject: [PATCH] Fix moving symlinks

---
 src/main/java/org/caosdb/server/utils/FileUtils.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/caosdb/server/utils/FileUtils.java b/src/main/java/org/caosdb/server/utils/FileUtils.java
index 70ba0030..c07d4375 100644
--- a/src/main/java/org/caosdb/server/utils/FileUtils.java
+++ b/src/main/java/org/caosdb/server/utils/FileUtils.java
@@ -525,7 +525,7 @@ public class FileUtils {
   }
 
   private static void callPosixUnlink(File file) throws IOException, InterruptedException {
-    final Process cmd = Runtime.getRuntime().exec("unlink " + file.getAbsolutePath());
+    final Process cmd = Runtime.getRuntime().exec(new String[] {"unlink", file.getAbsolutePath()});
     if (cmd.waitFor() != 0) {
       throw new CaosDBException("could not unlink " + file.getAbsolutePath());
     }
@@ -539,7 +539,7 @@ public class FileUtils {
       @Override
       public void undo() {
         try {
-          Runtime.getRuntime().exec("ln -s " + path + " " + file.getAbsolutePath());
+          Runtime.getRuntime().exec(new String[] {"ln", "-s", path, file.getAbsolutePath()});
         } catch (final IOException e) {
           e.printStackTrace();
         }
-- 
GitLab