forked from StarOpenSource/Engine
Make FileAccess.createLink accept FileAccess' only
This commit is contained in:
parent
f0c43d7b53
commit
ce7bd233b6
1 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue