From ce7bd233b66bb68771af5022c99869c13df93856 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Mon, 16 Dec 2024 02:37:09 +0100 Subject: [PATCH] Make FileAccess.createLink accept FileAccess' only --- .../de/staropensource/engine/base/utility/FileAccess.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 cf163c651..dbe1e124a 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) }