diff --git a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/RelativeUrl.kt b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/RelativeUrl.kt index 01c57879..75d45f0f 100644 --- a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/RelativeUrl.kt +++ b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/RelativeUrl.kt @@ -1,12 +1,11 @@ package nl.avisi.structurizr.site.generatr.site -import java.nio.file.Path -import kotlin.io.path.relativeTo +import java.io.File fun String.asUrlToDirectory(otherUrl: String) = "${this.asUrlToFile(otherUrl)}/" -fun String.asUrlToFile(otherUrl: String) = - if (otherUrl == this) "." - else Path.of(this) - .relativeTo(Path.of(otherUrl)).toString() - +fun String.asUrlToFile(relativeTo: String): String = + if (relativeTo == this) "." + else File(this) + .relativeTo(File(relativeTo)) + .toString()