[jboss-user] [Beginners Corner] - best way to read in properties ?

devireddy do-not-reply at jboss.com
Fri Oct 10 14:42:02 EDT 2008


HI

 I read in a book that using Java IO and directly reading in a properties file is not good in case of EJBs or any web application that is supposed to be portable. So, If I have to use classloader, which of the following is a better option.

1. in = ClassLoader.getSystemResourceAsStream("properties.properties");

2. in =  this.getClass().getClassLoader().getSystemResourceAsStream("properties.properties");

3. in = Thread.currentThread.getClass().getClassLoader().getSystemResourceAsStream("properties.properties");

will these work if I have my properties file in the jar file that is deployed to server.



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4181605#4181605

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4181605



More information about the jboss-user mailing list