Accessing and encoding of properties files
- by NoozNooz42
I'm used to work with properties files, for example from Ant. Where I can simply reference the property file doing something like that:
<property file="webapp_DO_NOT_COMMIT.properties"/>
(the file is so named because our DVCS is configured as to never commit files containing "DO_NOT_COMMIT" to prevent committing credentials/passwords/etc.)
Here's a very simple .properties file example:
passwd=brokencleartextpassword
Now I want to put some configuration in another, similar, properties file that I need to access from my Java code. How should I go about it?
I also have another related question: is the character encoding of .properties file defined by any spec?