Java – use the properties in the properties file
I apologize for the title I can't find a better way to explain the situation
I use the property class to load property files, such as URLs http://www.exampledepot.com/egs/java.util/Props.html As described in
My question is, can I use properties in this property file?
Example:
test. properties
url.main="http://mysite.com" url.games={url.main}/games url.images={url.main}/images . . .
Can I use other syntax?
thank you
Solution
I've never seen it before Of course you can make your own preprocessor As long as the referenced property occurs before any reference to it, you should be able to implement it with some regular expression / String substitution But: I don't recommend this method
Better address duplication by defining different attributes:
>Change: URL games = {url.main} / games into url. games_ extension = / games> prepend:url. Main to URL games_ Extension to get the full game URL in the application code