1 Reply Latest reply on Jul 30, 2013 3:58 AM by ybxiang.china

    Need to read from a file outside the EAR, but not from the default jboss.server.data.dir

    streety

      Hi

      Our complete project is kept as a separate package which is having its own standalone.xml. Now I need to put some .txt file in that folder which would be read during runtime. I know how to use the default server config and data locations such as jboss.server.data/config.dir, but I cannot use it as per project specifications.

      Thanks in advance.

        • 1. Re: Need to read from a file outside the EAR, but not from the default jboss.server.data.dir
          ybxiang.china

          define your URI in system properties in standalone.xml.

           

          Here is an example:

           

          <server xmlns="urn:jboss:domain:1.4">

              <extensions>

                  ...

              </extensions>

           

              <system-properties>

                  ...

                  <property name="ybxiang.forum.backrest.script.path" value="D:\\develop\\projects\\javaarm\\backup_all.bat"/>

                  ...

           

          Now you can get it by java code:

          System.getProperty("ybxiang.forum.backrest.script.path");

           

           

          You can change "ybxiang.forum.backrest.script.path"'s value at any time.