I often had to deal with loading property files with applications
running on different os types written using different frameworks
(Spring/Stripes/Eclipse RCP/SWT/Guice). The problem I often had to
deal with is to locate the property file. Some frameworks modify the
class loader so in such cases it
On 01-04-2009 at 01:09, 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().getResource
ResourceBundle rb = ResourceBundle.getBundle("myApp.properties", new
Locale("en", "EN"));
Of course, you should use the same locale as your request.
--
Samuel Santos
http://www.samaxes.com/
On Wed, Apr 1, 2009 at 2:24 AM, Philip Constantinou <
pconstanti...@evernote.com> wrote:
> Apache Common
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
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 prefe