sirekanian 3 лет назад
Родитель
Сommit
90c43c9711
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      src/main/kotlin/com/sirekanyan/bump/VersionChecker.kt

+ 4 - 4
src/main/kotlin/com/sirekanyan/bump/VersionChecker.kt

@@ -47,16 +47,16 @@ class VersionChecker(
     private fun CoroutineScope.downloadMetadataAsync(key: ArtifactKey): Deferred<String?> =
     private fun CoroutineScope.downloadMetadataAsync(key: ArtifactKey): Deferred<String?> =
         async(Dispatchers.IO) {
         async(Dispatchers.IO) {
             try {
             try {
-                val url = Url(key.url)
-                if (url.protocol.name == "file") {
-                    val file = File(url.fullPath)
+                if (key.url.startsWith("file:/")) {
+                    val path = key.url.replace(Regex("^file:/+"), "/")
+                    val file = File(path)
                     if (file.exists()) {
                     if (file.exists()) {
                         file.readText()
                         file.readText()
                     } else {
                     } else {
                         null
                         null
                     }
                     }
                 } else {
                 } else {
-                    httpClient.get<String>(url)
+                    httpClient.get<String>(key.url)
                 }
                 }
             } catch (exception: ClientRequestException) {
             } catch (exception: ClientRequestException) {
                 if (exception.response.status.value == 404) {
                 if (exception.response.status.value == 404) {