URLClassLoader does not find folders in jar if not ending with '/'?
- by IttayD
A 3rd party library (jersey) is trying to find Java packages by ClassLoader#findResource passing in the package name as file name (replacing dots with slashes). What I see is that if I pass a package name as 'a.b.c' (converted to 'a/b/c') it is not found, but if I pass 'a.b.c.' it is found. This translated directly to URL#inputStream that uses ZipFile which doesn't find the entry a/b/c, but finds the entry a/b/c/
I'm trying to find if this is the intended behavior or is there something wrong with my packaging (maven) or the URLs passed to the classloader (which look like jar:file://C:/.../foo.jar!/)