markt-asf commented on a change in pull request #333: URL: https://github.com/apache/tomcat/pull/333#discussion_r470802517
########## File path: java/org/apache/tomcat/util/scan/JarIndex.java ########## @@ -0,0 +1,61 @@ +package org.apache.tomcat.util.scan; Review comment: No ALv2 Header Why is this class in this package when it is only used in `org.apache.catalina.webresources`? ########## File path: java/org/apache/catalina/webresources/JarResourceSet.java ########## @@ -59,6 +63,36 @@ public JarResourceSet(WebResourceRoot root, String webAppMount, String base, super(root, webAppMount, base, internalPath); } + @Override + public WebResource getResource(String path, List<List<WebResourceSet>> allResources) { + JarIndex jarIndex = getJarIndex(); + if(jarIndex==null){ + return getResource(path); + } + String webAppMount = getWebAppMount(); + if (path.startsWith(getWebAppMount())) { + String pathInJar = getInternalPath() + path.substring( + webAppMount.length()); + if (pathInJar.length() > 0 && pathInJar.charAt(0) == '/') { + pathInJar = pathInJar.substring(1); + } + List<String> jarFiles = jarIndex.get(pathInJar); + if(jarFiles!=null){ Review comment: Why is this here rather than in `StandardRoot` ? ########## File path: java/org/apache/catalina/WebResourceSet.java ########## @@ -36,6 +37,10 @@ */ WebResource getResource(String path); + default WebResource getResource(String path, List<List<WebResourceSet>> allResources){ Review comment: This looks wrong. A single `WebResourceSet` shouldn't need to be passed a reference to `allResources`. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org