From 27af2f997ecdf34cb6d89eea79002f2444ccec73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mat=C4=9Bj=C4=8Dek?= Date: Sun, 24 Nov 2024 17:49:05 +0100 Subject: [PATCH] Fixed RarHandler - non-absolute URL to File conversion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - As the Archive#getURI says, the method can return nearly anything and there no guarantee that the URI can be converted to a File. - Sometimes it is an absolute file, sometimes relative path, sometimes URI pointing to a file inside jar inside ear. - This minimalistic fix avoids an exception, similar is on other places. Signed-off-by: David Matějček --- .../java/com/sun/enterprise/connectors/module/RarHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/module/RarHandler.java b/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/module/RarHandler.java index d5ab44a7bdd..6a7fab39dd4 100644 --- a/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/module/RarHandler.java +++ b/appserver/connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/module/RarHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation * Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the @@ -150,7 +150,7 @@ private boolean isEmbedded(DeploymentContext context) { public List getClassPathURIs(ReadableArchive archive) { List uris = super.getClassPathURIs(archive); try { - File archiveFile = new File(archive.getURI()); + File archiveFile = new File(archive.getURI().getSchemeSpecificPart()); if (archiveFile.exists() && archiveFile.isDirectory()) { // add top level jars uris.addAll(ASClassLoaderUtil.getLibDirectoryJarURIs(archiveFile));