From 0c29e68b37176ed09c5d31b27dcbac9364df9d29 Mon Sep 17 00:00:00 2001 From: Joe Lauer Date: Mon, 30 Sep 2024 20:06:54 -0400 Subject: [PATCH] Fix Resources.file on Java 17/21 --- crux-util/src/main/java/com/fizzed/crux/util/Resources.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crux-util/src/main/java/com/fizzed/crux/util/Resources.java b/crux-util/src/main/java/com/fizzed/crux/util/Resources.java index 5ee6856..7c15a74 100644 --- a/crux-util/src/main/java/com/fizzed/crux/util/Resources.java +++ b/crux-util/src/main/java/com/fizzed/crux/util/Resources.java @@ -134,7 +134,7 @@ static public void file(String resourceName, BiConsumer consumer) // we'll skip the file: part too String jarPath = jarPathAndInnerFile.substring(5, sepPos); String filePath = jarPathAndInnerFile.substring(sepPos + 1); - try (FileSystem fs = FileSystems.newFileSystem(Paths.get(jarPath), null)) { + try (FileSystem fs = FileSystems.newFileSystem(Paths.get(jarPath), Resources.class.getClassLoader())) { consumer.accept(false, fs.getPath(filePath)); return; }