Apache Commons configurations:

http://commons.apache.org/configuration/howto_properties.html

Is a really nice set of libraries that is a bit better than just using  
java.util.Properties. It's abstraction also makes it easier to change  
your mind about where you're putting your properties.

If I remember correctly the reason for the URL is a legacy from the  
old applet days.

It's no better than using the InputStream.


On Mar 31, 2009, at 6:09 PM, AK wrote:

> On IRC I got the following suggestion for reading a properties file:
>
> URL aURL = getClass().getClassLoader().getResource("myApp.properties")
>
> The other suggestion I found online was:
>
> InputStream inStream =  
> this.getClass().getClassLoader().getResourceAsStream
> ("myApp.properties");
>
> Is there a preference or advantage of one way over the other?
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users


------------------------------------------------------------------------------
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to