Question

I have a properties file inside conf directory in a jboss 6 server.

How i can get a group or all the key and values from that file inside my application:

<attribute name="URLList">
  ./conf/crawler.properties
</attribute>

thanks

Was it helpful?

Solution

Did this, but using java.util.Properties:

String path = System.getProperty("jboss.server.config.url") + propertiesFileName;
Properties props = new Properties();
URL url = new URL(path);
props.load(url.openStream());

The Properties class has all the neccessary methods for reading key-value-pairs (it also implements Map<Object,Object>).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top