Package org.drools.util
Class JarUtils
java.lang.Object
org.drools.util.JarUtils
Utility to access jar files
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetPathWithoutScheme(URL url) get path removing scheme prefix including additional scheme e.g.static StringnormalizeSpringBootResourceUrlPath(String resourceUrlPath) Fix resource urls are acquired by spring boot classloader's getResources() for Spring Boot fat jar in order to be consistent with the actual path in the jar file.static StringreplaceNestedPathForSpringBoot32(String urlPath) Replace the new spring-boot nested path representation "/!BOOT-INF/" (introduced since 3.2) with the old "!/BOOT-INF/".
-
Method Details
-
normalizeSpringBootResourceUrlPath
Fix resource urls are acquired by spring boot classloader's getResources() for Spring Boot fat jar in order to be consistent with the actual path in the jar file. For example, Spring Boot 3.2 classloader's getResources() returns like "jar:nested:/path/to/demo.jar/!BOOT-INF/classes/!/org/example/MyClass.class" while the actual path in the jar file is "jar:nested:/path/to/demo.jar!/BOOT-INF/classes/org/example/MyClass.class" This method normalizes only the path part. The scheme part (e.g. "jar:nested:") can be handled by getPathWithoutScheme- Parameters:
resourceUrlPath- resource url path- Returns:
- normalized resource url path
-
replaceNestedPathForSpringBoot32
Replace the new spring-boot nested path representation "/!BOOT-INF/" (introduced since 3.2) with the old "!/BOOT-INF/". Because the new path representation doesn't meet the path manipulation in the drools codebase. See https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.2-Release-Notes#nested-jar-support -
getPathWithoutScheme
get path removing scheme prefix including additional scheme e.g. "jar:nested:"
-