From 7dcb378bd4d79369daaca9c72f92a39ec76e44e2 Mon Sep 17 00:00:00 2001 From: "David M. Lloyd" Date: Mon, 25 Nov 2024 04:23:27 -0600 Subject: [PATCH] Open JAR in MR mode in all situations (#378) Currently it is only opened as an MR JAR when loaded from the filesystem due to an oversight. --- .../io/smallrye/common/resource/JarFileResourceLoader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resource/src/main/java/io/smallrye/common/resource/JarFileResourceLoader.java b/resource/src/main/java/io/smallrye/common/resource/JarFileResourceLoader.java index c292db5..ec3599b 100644 --- a/resource/src/main/java/io/smallrye/common/resource/JarFileResourceLoader.java +++ b/resource/src/main/java/io/smallrye/common/resource/JarFileResourceLoader.java @@ -7,6 +7,7 @@ import java.util.jar.JarEntry; import java.util.jar.JarFile; import java.util.jar.Manifest; +import java.util.zip.ZipFile; /** * A resource loader which corresponds to a JAR file. @@ -24,7 +25,7 @@ public final class JarFileResourceLoader implements ResourceLoader { */ public JarFileResourceLoader(final Path jarPath) throws IOException { this.base = jarPath.toUri().toURL(); - jarFile = new JarFile(jarPath.toFile()); + jarFile = new JarFile(jarPath.toFile(), true, ZipFile.OPEN_READ, JarFile.runtimeVersion()); } /**