-
Notifications
You must be signed in to change notification settings - Fork 284
Open
Description
There is an issue in 0.9.14 (at least with some classloaders) in ClasspathResolver line 43, where getResource returns a non null URL for non-existent paths in the JAR which results in assuming it is a directory, when it is actually a valid classpath template resource.
43 } else if (ccl.getResource(normalizeResourceName + "/") != null) {
44 // This is a directory
45 return null;
46 }'
Proposed fix:
- } else if (ccl.getResource(normalizeResourceName + "/") != null) {
- // This is a directory
- return null;
+ }
+ // Use JarURLConnection to accurately check if this is a directory in the jar
+ try {
+ JarURLConnection jarConn = (JarURLConnection) resource.openConnection();
+ JarEntry entry = jarConn.getJarEntry();
+ if (entry != null && entry.isDirectory()) {
+ return null;
+ }
+ } catch (IOException e) {
+ // If we can't check, assume it's a file and proceed
Metadata
Metadata
Assignees
Labels
No labels