public Set<String> findResourceNames(String location, URL locationUrl) throws IOException { JarFile jarFile = getJarFromUrl(locationUrl); try { // For Tomcat and non-expanded WARs. String prefix = jarFile.getName().toLowerCase().endsWith(".war") ? "WEB-INF/classes/" : ""; return findResourceNamesFromJarFile(jarFile, prefix, location); } finally { jarFile.close(); } }