Skip to content
Snippets Groups Projects
Verified Commit f3851da4 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

Fix moving symlinks

parent fe87cd69
No related branches found
No related tags found
No related merge requests found
Checking pipeline status
...@@ -525,7 +525,7 @@ public class FileUtils { ...@@ -525,7 +525,7 @@ public class FileUtils {
} }
private static void callPosixUnlink(File file) throws IOException, InterruptedException { 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) { if (cmd.waitFor() != 0) {
throw new CaosDBException("could not unlink " + file.getAbsolutePath()); throw new CaosDBException("could not unlink " + file.getAbsolutePath());
} }
...@@ -539,7 +539,7 @@ public class FileUtils { ...@@ -539,7 +539,7 @@ public class FileUtils {
@Override @Override
public void undo() { public void undo() {
try { try {
Runtime.getRuntime().exec("ln -s " + path + " " + file.getAbsolutePath()); Runtime.getRuntime().exec(new String[] {"ln", "-s", path, file.getAbsolutePath()});
} catch (final IOException e) { } catch (final IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment