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
This commit is contained in:
Hugues Malphettes 2011-05-18 03:50:46 +00:00
parent 3b7949bc8c
commit d6639b77b5
1 changed files with 8 additions and 1 deletions

View File

@ -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"));
}
}
}
}