mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-25 16:42:34 +00:00
closes: #43975
(cherry picked from commit 819de5e33a)
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
This commit is contained in:
@@ -20,6 +20,8 @@ package org.keycloak.quarkus.deployment;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Path;
|
||||
@@ -1041,9 +1043,13 @@ class KeycloakProcessor {
|
||||
// descriptor is at META-INF/
|
||||
Path basePath = Path.of(url.getPath()).getParent().getParent();
|
||||
|
||||
String path = basePath.resolve(fileName).toString();
|
||||
if (!path.startsWith(url.getProtocol())) {
|
||||
path = url.getProtocol() + ":" + path;
|
||||
}
|
||||
try {
|
||||
return basePath.resolve(fileName).toUri().toURL().openStream();
|
||||
} catch (IOException e) {
|
||||
return new URI(path).toURL().openStream();
|
||||
} catch (IOException | URISyntaxException e) {
|
||||
throw new RuntimeException("Failed to read script file from: " + fileName);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user