mirror of
https://github.com/LamGC/ScalaBot.git
synced 2025-04-30 06:37:29 +00:00
refactor(utils): 移除不再使用的方法.
当初开发 Maven 仓库搜索器时意外提交的, 已经可以移除了.
This commit is contained in:
parent
8174f2a3a2
commit
95ad251826
@ -7,7 +7,6 @@ import org.eclipse.aether.artifact.Artifact
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.FileFilter
|
import java.io.FileFilter
|
||||||
import java.io.FilenameFilter
|
import java.io.FilenameFilter
|
||||||
import java.net.URL
|
|
||||||
|
|
||||||
internal fun ByteArray.toHexString(): String = joinToString("") { it.toString(16) }
|
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." }
|
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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user