Is there something magic about a folder with the name 'resource' as opposed to something else. I have a file in 'resource' and when I try to load it, it works fine.
ClassLoader loader=Thread.currentThread().getContextClassLoader();
InputStream propFile=loader.getResourceAsStream("KCBSEvents/resource/build.properties");
I do a prop.load(propFile) to load properties.
When I try to use similar logic to load an image from a directory named 'Images', it fails. Both directories are at the same level in my tree.
ClassLoader loader=Thread.currentThread().getContextClassLoader();
java.net.URL logoURL=loader.getClass().getResource("KCBSEvents/Images/KCBSLogo.jpg");
The result is that 'logoURL' is null. I can only conclude that either there is something magic about the directory name 'resource' or 'getResource' works differently than 'getResourceAsStream'. Can someone explain what is going on? TIA.