From 78fba948c4c5d72d50b4a1030e5cf0d576eeba16 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Tue, 1 Oct 2024 19:20:04 +0200 Subject: [PATCH] Escape exclamation mark escaping when creating a zip file Fixes https://github.com/quarkusio/quarkus/issues/43273 --- src/main/java/io/quarkus/fs/util/ZipUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/quarkus/fs/util/ZipUtils.java b/src/main/java/io/quarkus/fs/util/ZipUtils.java index b81967d..fbe09a0 100644 --- a/src/main/java/io/quarkus/fs/util/ZipUtils.java +++ b/src/main/java/io/quarkus/fs/util/ZipUtils.java @@ -66,7 +66,8 @@ public static void unzip(Path zipFile, Path targetDir) throws IOException { public static URI toZipUri(Path zipFile) throws IOException { URI zipUri = zipFile.toUri(); try { - zipUri = new URL(JAR_URI_PREFIX + zipUri.getScheme() + "://" + zipUri.getRawPath() + "!/").toURI(); + zipUri = new URL(JAR_URI_PREFIX + zipUri.getScheme() + "://" + + zipUri.getRawPath().replace("!/", "%21/") + "!/").toURI(); } catch (URISyntaxException e) { throw new IOException("Failed to create a JAR URI for " + zipFile, e); }