Fix theme resource loading on Windows, and enable additional test in jdk-integration-tests (#33512)
Closes #33508 Signed-off-by: stianst <stianst@gmail.com>
This commit is contained in:
parent
de151e6a03
commit
6092524d79
2 changed files with 7 additions and 1 deletions
|
@ -15,7 +15,12 @@ public class ResourceLoader {
|
|||
Path rootPath = Path.of("/", root).normalize().toAbsolutePath();
|
||||
Path resourcePath = rootPath.resolve(resource).normalize().toAbsolutePath();
|
||||
if (resourcePath.startsWith(rootPath)) {
|
||||
URL url = classLoader().getResource(resourcePath.toString().substring(1));
|
||||
if (File.separatorChar == '/') {
|
||||
resource = resourcePath.toString().substring(1);
|
||||
} else {
|
||||
resource = resourcePath.toString().substring(2).replace('\\', '/');
|
||||
}
|
||||
URL url = classLoader().getResource(resource);
|
||||
return url != null ? url.openStream() : null;
|
||||
} else {
|
||||
return null;
|
||||
|
|
|
@ -15,3 +15,4 @@ SSOTest
|
|||
SamlClientTest
|
||||
TransactionsTest
|
||||
X509BrowserLoginTest
|
||||
ThemeResourceProviderTest
|
||||
|
|
Loading…
Reference in a new issue