From 95ad251826c2e2b99fc9e0f816d9bd106a947dd1 Mon Sep 17 00:00:00 2001 From: LamGC Date: Sat, 7 May 2022 01:43:15 +0800 Subject: [PATCH] =?UTF-8?q?refactor(utils):=20=E7=A7=BB=E9=99=A4=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E4=BD=BF=E7=94=A8=E7=9A=84=E6=96=B9=E6=B3=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当初开发 Maven 仓库搜索器时意外提交的, 已经可以移除了. --- scalabot-app/src/main/kotlin/util/Utils.kt | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/scalabot-app/src/main/kotlin/util/Utils.kt b/scalabot-app/src/main/kotlin/util/Utils.kt index 550aae3..252df59 100644 --- a/scalabot-app/src/main/kotlin/util/Utils.kt +++ b/scalabot-app/src/main/kotlin/util/Utils.kt @@ -7,7 +7,6 @@ import org.eclipse.aether.artifact.Artifact import java.io.File import java.io.FileFilter import java.io.FilenameFilter -import java.net.URL internal fun ByteArray.toHexString(): String = joinToString("") { it.toString(16) } @@ -97,17 +96,3 @@ private object UtilsInternal { log.debug { "All registered hook resources have been closed." } } } - -fun URL.resolveToFile(canonical: Boolean = true): File { - if ("file" != protocol) { - throw ClassCastException("Only the URL of the `file` protocol can be converted into a File object.") - } - - val urlString = toString().substringAfter(':') - val file = File(urlString) - return if (canonical) { - file.canonicalFile - } else { - file - } -}