This is a real headscratcher for me. I cannot for the life of me get the class loader to find a .svg resource. I can change the extension to absolutely anything else (e.g. right now I have made them .svh files) and it gives me a valid URL, but I change them back to .svg and I only ever get null. WHAT THE HELL!!
Somebody please save me here.
// This NEVER works
URL url = SVGUtils.class.getClassLoader().getResource("com/acarter/applicationx/data/xml/checkbox_0.svg");
// So I rename the file extension to anything else (e.g. *.svz) and I get a valid URL
URL url = SVGUtils.class.getClassLoader().getResource("com/acarter/applicationx/data/xml/checkbox_0.svz");
right, like if you use eclipse, make sure the resource is copied over to the bin dir etc...
Thats exactly the problem! Eclipse is not copying the *.svg files to the bin directory but I can't seem to fix it either. I even tried adding a specific build path inclusion for only svg files, an it still ignored them. I wonder if this is a Eclipe Ganymede bug or something, I've never had these kind of problems before (I also wasn't woking with svg's before Ganymede). And its specific to the extension, weird.