Re: How to load properties as resources?



> I'd do it more directly with:
> InputStream fis = MyApp.class.getResourceAsStream( "Common.properties" );

I did start with something similar:

InputStream is =
SystemProperties.class.getClassLoader().getResourceAsStream("Common.properties");

....but this was throwing a NPE since getClassLoader() returns null in
this case.

I also tried:

InputStream is =
SystemProperties.class.getResourceAsStream("Common.properties");

....which gave me a null result.

> 1. unsigned Applets are not permitted to tinker with Classloaders

Sorry, I should have made specific: this is not an Applet, it's a Java
application with a main().

> 2. the classloader for java.lang.SystemProperties is not necessarily
> the same one used for finding your App and its resources.

Ahh, yes, and this feels like the crux of my question: How can I get
the class loader returned from:

ClassLoader.getSystemClassLoader();

....to find my resources? No path that I can think of seems to work.

Thanks again.

.