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 cf163c6..dbe1e12 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 @@ -618,12 +618,12 @@ class FileAccess { * @since v1-alpha10 */ @Throws(IOAccessException::class) - fun createLink(destination: String, hard: Boolean): FileAccess { + fun createLink(destination: FileAccess, hard: Boolean): FileAccess { if (!exists()) try { logger.diag("Creating a ${if (hard) "hard" else "symbolic"} link at '${unformatFromPath(path)}'") - if (hard) Files.createLink(path, formatToPath(destination)) - else Files.createSymbolicLink(path, formatToPath(destination)) + if (hard) Files.createLink(path, destination.path) + else Files.createSymbolicLink(path, destination.path) } catch (exception: Exception) { throw IOAccessException("Unable to create a new ${if (hard) "hard" else "symbolic"} link at '${unformatFromPath(path)}'", exception) }