From 23e270b603eb32472b8ef4a5f44c01af57fd049f Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Mon, 23 Nov 2015 18:53:18 +0100 Subject: Use Java 8 Path API to relativize paths instead of rolling a custom version. Fixes various IOExceptions thrown during generation. --- src/Utilities/Path.kt | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'src/Utilities') diff --git a/src/Utilities/Path.kt b/src/Utilities/Path.kt index 36277d9f..05838499 100644 --- a/src/Utilities/Path.kt +++ b/src/Utilities/Path.kt @@ -1,19 +1,5 @@ package org.jetbrains.dokka import java.io.File -import java.io.IOException - -fun File.getRelativePath(name: File): File { - val parent = parentFile ?: throw IOException("No common directory") - - val basePath = canonicalPath + File.separator; - val targetPath = name.canonicalPath; - - if (targetPath.startsWith(basePath)) { - return File(targetPath.substring(basePath.length)) - } else { - return File(".." + File.separator + parent.getRelativePath(name)) - } -} fun File.appendExtension(extension: String) = if (extension.isEmpty()) this else File(path + "." + extension) -- cgit