-
1. Re: The code to get the server data Dir of AS7
xin.zhang.song Sep 11, 2012 1:41 AM (in response to xin.zhang.song)any comments?
-
2. Re: The code to get the server data Dir of AS7
nickarls Sep 11, 2012 2:21 AM (in response to xin.zhang.song)Haven't tried but if you do a "new File()" you might end up in the bin dir (working directory) of the AS and navigate from parent down to data from there.
-
3. Re: The code to get the server data Dir of AS7
nickarls Sep 11, 2012 2:28 AM (in response to nickarls)1 of 1 people found this helpfulLooking at the boot log you should also be able to pick it up from the environment at "jboss.server.data.dir"
-
4. Re: The code to get the server data Dir of AS7
ranga033 Sep 11, 2012 2:37 AM (in response to xin.zhang.song)1 of 1 people found this helpfulI think if you try read the System property "jboss.server.data.dir" , you should get what you are expecting...If in domain model and want to go to domain/data folder try "jboss.domain.data.dir' .
More details https://docs.jboss.org/author/display/AS71/Command+line+parameters
-
5. Re: The code to get the server data Dir of AS7
wdfink Sep 11, 2012 5:39 AM (in response to ranga033)Remember that accessing the filesystem out of the application will break the EE specification.
I saw many applications with such approach (and it worked), but you might come in trouble if you are running in a cluster or similar environment where requests might change the instances and you have not longer access to the specific File or Directory.