diff --git a/base/src/main/kotlin/de/staropensource/engine/base/utility/FileAccess.kt b/base/src/main/kotlin/de/staropensource/engine/base/utility/FileAccess.kt index 7eb716a..cf163c6 100644 --- a/base/src/main/kotlin/de/staropensource/engine/base/utility/FileAccess.kt +++ b/base/src/main/kotlin/de/staropensource/engine/base/utility/FileAccess.kt @@ -335,13 +335,17 @@ class FileAccess { /** * Returns if this file or directory exists. * + * @param noFollowSymbolicLink checks the symbolic link destination if `false`, checks the link itself if `true`. Has no effect if there doesn't exist a link at this location * @return exists? * @throws IOAccessException on IO error * @since v1-alpha10 */ @Throws(IOAccessException::class) - fun exists(): Boolean { - return Files.exists(path) + fun exists(noFollowSymbolicLink: Boolean = false): Boolean { + return if (noFollowSymbolicLink) + Files.exists(path, LinkOption.NOFOLLOW_LINKS) + else + Files.exists(path) } /**