summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Ritter2020-02-06 16:10:40 +0100
committerSteffen Ritter2020-02-06 16:10:40 +0100
commit36216a5dfb12b65d7f67d518ece1393778c94a73 (patch)
tree78109dddcd4c79bbbd4a384376488df9838c48d1
parentscripts/mount-store: hack for missing dnbd3 folder (diff)
downloadtmlite-bwlp-36216a5dfb12b65d7f67d518ece1393778c94a73.tar.gz
tmlite-bwlp-36216a5dfb12b65d7f67d518ece1393778c94a73.tar.xz
tmlite-bwlp-36216a5dfb12b65d7f67d518ece1393778c94a73.zip
[Symlink] And don't follow symlinks when checking if file exists
-rw-r--r--src/main/java/org/openslx/taskmanager/tasks/Symlink.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/org/openslx/taskmanager/tasks/Symlink.java b/src/main/java/org/openslx/taskmanager/tasks/Symlink.java
index 44919fc..3dfba02 100644
--- a/src/main/java/org/openslx/taskmanager/tasks/Symlink.java
+++ b/src/main/java/org/openslx/taskmanager/tasks/Symlink.java
@@ -2,6 +2,7 @@ package org.openslx.taskmanager.tasks;
import java.io.File;
import java.nio.file.Files;
+import java.nio.file.LinkOption;
import java.nio.file.Paths;
import org.apache.commons.io.FileUtils;
@@ -79,7 +80,7 @@ public class Symlink extends AbstractTask
*/
public static boolean deleteRecursiveIfExists( File item )
{
- if ( !item.exists() )
+ if ( !Files.exists( item.toPath(), LinkOption.NOFOLLOW_LINKS ) )
return true;
boolean ret = true;
if ( !Files.isSymbolicLink( item.toPath() ) && item.isDirectory() ) {