diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java index 4b9a49608da..bdb117044ee 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java @@ -38,36 +38,13 @@ public class MetaInfConfiguration implements Configuration public static final String JARS_WITH_FRAGMENTS = "org.eclipse.jetty.webFragments"; public static final String JARS_WITH_RESOURCES = WebInfConfiguration.RESOURCE_URLS; + + public void preConfigure(final WebAppContext context) throws Exception { //Find all jars in WEB-INF - Resource web_inf = context.getWebInf(); - Resource web_inf_lib = web_inf.addPath("/lib"); - List urls = new ArrayList(); - - if (web_inf_lib.exists() && web_inf_lib.isDirectory()) - { - String[] files=web_inf_lib.list(); - for (int f=0;files!=null && f urls = findJars(context); + JarScanner fragScanner = new JarScanner() { public void processEntry(URL jarUrl, JarEntry entry) @@ -133,5 +110,44 @@ public class MetaInfConfiguration implements Configuration addJar(context,JARS_WITH_RESOURCES,jarUrl); } } - + + /** + * Look for jars in WEB-INF/lib + * @param context + * @return + * @throws Exception + */ + protected List findJars (WebAppContext context) + throws Exception + { + List urls = new ArrayList(); + + Resource web_inf = context.getWebInf(); + Resource web_inf_lib = web_inf.addPath("/lib"); + + + if (web_inf_lib.exists() && web_inf_lib.isDirectory()) + { + String[] files=web_inf_lib.list(); + for (int f=0;files!=null && f