The jboss.server.config.url property will give you the conf directory as a URL (file:///c:/Servers/jboss-5.1.0.GA/server/default/conf).
Alternately, the conf directory is in the classpath, so you could use ClassLoader.getResource() or getResourceAsStream to load it also.
Hi, thank you for your answer.
I have used the jboss.server.conf property and it has returned me this: "file:/C:/Servers/jboss-5.1.0.GA/server/default/conf/", just as you said it would.
However, since I am opening a properties file using the code below, I am getting a FileNotFoundException because of the "file:/" at the beginning of the property string.
propertiesFile = new FileInputStream(path);
Is there a way to retrieve this property without the "file:/", or is it better just trim the resulting String after it?
1 of 1 people found this helpful
propertiesFile = new FileInputStream(new File(new URI(path)));
I've done as you suggested and everything worked fine.
Once again thank you for your help!