2 Replies Latest reply on Jul 1, 2008 9:48 PM by gan.gary

    read a local properties file

    gan.gary

      Hi all, I have a JBoss+Hbernate app. I need a configurable file. Can i keep it in "jboss-service.xml" or a new properties file? But eventually my hibernate is going to package into an *.jar file. How are user going to configure?

        • 1. Re: read a local properties file
          peterj

          Here is one possible way of doing this.

          Place the properties (or data) file into server/xxx/data. (I placed mine in a subdirectory such as server/xxx/data/mystuff)

          In your program, use the jboss.server.data.dir property to get the path for the data directory, and use that to access the properties file. For example:

          String dataDir = System.getProperty("jboss.server.data.dir");
          Properties prop = Properties.load(new FileInputStream(dataDir + "/mystuff/my.properties"));

          • 2. Re: read a local properties file
            gan.gary

            great, thanks!