Pablo Fernandez C wrote:
3) About question 2), the Properties should o should not be in the JAR? I think I got it work putting them in a near folder, but I was not very sure about what I was doing...
Claude Moore wrote:
So, If I were you I won't use properties files embedded in a Jar file. In my humble opinion, in most case it's useless....
Regards !
Claude.
Pablo Fernandez C wrote:
To clarify my doubts about this topic, I have some questions:
1) Which is the best way to load properties? I read somewhere some ways about the getResourceAsStream() and getResourceBundle(), but it seems easier to me the FileInputStream method. Is it worse?
3) About question 2), the Properties should o should not be in the JAR? I think I got it work putting them in a near folder, but I was not very sure about what I was doing...
4) From where point are searched the Properties? Does the path begins in the default package so if the property is "/a.properties", should it be in the default package? If it is only "a.properties", where is it searched from?
6) The thing that get me more nervous is that it works sometimes, but I do not understand why it is not always or never. I have read here:
http://download.oracle.com/javase/tutorial/essential/environment/properties.html
that "the application creates another Properties object and loads the properties that were saved from the last time the application was run."