Author: markt Date: Mon Aug 27 18:43:18 2012 New Revision: 1377786 URL: http://svn.apache.org/viewvc?rev=1377786&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53783 Handle case where tool generating JARs does not generate entries for directories. Patch by Violeta Georgieva.
Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ ------------------------------------------------------------------------------ Merged /tomcat/trunk:r1377785 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1377786&r1=1377785&r2=1377786&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java Mon Aug 27 18:43:18 2012 @@ -1684,8 +1684,15 @@ public class ContextConfig implements Li // Note: Ignore file URLs for now since only jar URLs will be accepted if ("jar".equals(url.getProtocol())) { jar = JarFactory.newInstance(url); - if (jar.entryExists("META-INF/resources/")) { - context.addResourceJarUrl(url); + jar.nextEntry(); + String entryName = jar.getEntryName(); + while (entryName != null) { + if (entryName.startsWith("META-INF/resources/")) { + context.addResourceJarUrl(url); + break; + } + jar.nextEntry(); + entryName = jar.getEntryName(); } } else if ("file".equals(url.getProtocol())) { FileDirContext fileDirContext = new FileDirContext(); Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1377786&r1=1377785&r2=1377786&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Mon Aug 27 18:43:18 2012 @@ -168,6 +168,11 @@ wrong point because the <code>isMatchAfter </code> logic was inverted. (markt) </fix> + <fix> + <bug>53783</bug>: Correctly handle JARs generated by tools that do not + create specific entries for directories. Patch provided by Violeta + Georgieva. (markt) + </fix> </changelog> </subsection> <subsection name="Coyote"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org