Skip to content

Commit

Permalink
Get rid of NestedJarFile
Browse files Browse the repository at this point in the history
  • Loading branch information
Griefed committed Dec 8, 2023
1 parent e0a2335 commit 13e4edb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion serverpackcreator-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ kotlin {
implementation("org.jetbrains.kotlin:kotlin-bom")
implementation("org.jetbrains.kotlin:kotlin-stdlib")
implementation(files("${layout.buildDirectory.asFile.get()}/resources/"))
api("org.springframework.boot:spring-boot-loader:3.2.0")
//api("org.springframework.boot:spring-boot-loader:3.2.0")
api("de.comahe.i18n4k:i18n4k-core-jvm:0.6.2")
api("com.electronwill.night-config:toml:3.6.7")
api("com.fasterxml.jackson.core:jackson-databind:2.15.3")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package de.griefed.serverpackcreator.api.utilities.common

import net.lingala.zip4j.ZipFile
import org.springframework.boot.loader.jar.NestedJarFile
import java.io.File
import java.net.JarURLConnection
import java.net.URI
Expand All @@ -31,7 +30,7 @@ import java.util.*
private val jar = "^jar:(file:.*[.]jar)!/.*".toRegex()
private val jarJar = "^(file:.*[.]jar)!.*[.]jar".toRegex()
private val jarNested = "^jar:nested:(.*[.]jar)!/.*".toRegex()
private val jarJarNEsted = "^(file:.*[.]jar)!.*[.]jar".toRegex()
private val jarJarNested = "^(file:.*[.]jar)!.*[.]jar".toRegex()
private val nested = ".*[.]jar!.*[.]jar".toRegex()
private val tmpDir = System.getProperty("java.io.tmpdir")
private const val JAR_FILE = "jar:file:"
Expand Down Expand Up @@ -68,7 +67,7 @@ fun <T : Any> Class<T>.source(
throw JarAccessException("Invalid Jar File URL String at JAR: $url")
}
} else {
val jar = (classResource.openConnection() as JarURLConnection).jarFile as NestedJarFile
val jar = (classResource.openConnection() as JarURLConnection).jarFile
source = File(jar.name)
}

Expand Down

0 comments on commit 13e4edb

Please sign in to comment.