diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultFileLocatorHelper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultFileLocatorHelper.java index 6b09190b5a4..4525a115134 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultFileLocatorHelper.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultFileLocatorHelper.java @@ -25,6 +25,7 @@ import java.util.zip.ZipFile; import org.eclipse.jetty.osgi.boot.utils.BundleFileLocatorHelper; import org.eclipse.jetty.util.URIUtil; +import org.eclipse.jetty.util.resource.FileResource; import org.osgi.framework.Bundle; /** @@ -70,8 +71,8 @@ public class DefaultFileLocatorHelper implements BundleFileLocatorHelper if (url.getProtocol().equals("file")) { // some osgi frameworks do use the file protocole directly in some - // situations - return new File(url.toURI()).getParentFile().getParentFile(); + // situations. Do use the FileResource to transform the URL into a File: URL#toURI is broken + return new FileResource(url).getFile().getParentFile().getParentFile(); } else if (url.getProtocol().equals("bundleentry")) {