Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
framework-5.6.12
-
None
Description
I'm working on Pax Web 8 and I try to unify welcome file handling across Jetty/Tomcat/Undertow.
When accessing directory entries from a bundle (org.osgi.framework.Bundle#getResource() I found different behavior between Felix and Equinox.
Trying to pass /META-INF/ and /META-INF resource names to getResource() method, I'm getting different results for Felix:
- bundle://19.0:1/META-INF/
- bundle://19.0:1/META-INF
and Equinox:
- bundleresource://19.fwk1529115495/META-INF/
- bundleresource://19.fwk1529115495/META-INF/
Underneath, both implementations call java.util.zip.ZipFile#getEntry(java.lang.String), but only Equniox has special org.eclipse.osgi.storage.bundlefile.BundleFile#fixTrailingSlash() method that adjusts the returned URL according to passed name and actual ZIP entry (java.util.zip.ZipEntry#getName().
This makes detection of a directory obtained from a bundle much harder with Felix. Also org.eclipse.jetty.util.resource.URLResource#isDirectory() is simply:
public boolean isDirectory() { return exists() && _urlString.endsWith("/"); }
Attachments
Issue Links
- links to