From d6639b77b5c6fc635b8c6b3f4ecadbdd1eee7b62 Mon Sep 17 00:00:00 2001 From: Hugues Malphettes Date: Wed, 18 May 2011 03:50:46 +0000 Subject: [PATCH] bug 346027 tolerate META-INF/web-fragment.xml that are inside a directory instead of a jar. git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@3199 7e9141cc-0065-0410-87d8-b60c137991c4 --- .../org/eclipse/jetty/webapp/FragmentConfiguration.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentConfiguration.java index 53b94aeb144..7770ab3b625 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentConfiguration.java @@ -69,7 +69,14 @@ public class FragmentConfiguration extends AbstractConfiguration { for (Resource frag : frags) { - metaData.addFragment(frag, Resource.newResource("jar:"+frag.getURL()+"!/META-INF/web-fragment.xml")); + if (frag.isDirectory()) //tolerate the case where the library is a directory, not a jar. useful for OSGi for example + { + metaData.addFragment(frag, Resource.newResource(frag.getURL()+"/META-INF/web-fragment.xml")); + } + else //the standard case: a jar most likely inside WEB-INF/lib + { + metaData.addFragment(frag, Resource.newResource("jar:"+frag.getURL()+"!/META-INF/web-fragment.xml")); + } } } }