-
1. Re: How to programmatically list deploy folders
peterj Sep 24, 2010 12:02 PM (in response to menegazzo)You can use the jboss.server.home.dir system property, which yields jboss_home/server/xxx, where xxx is the cofiguration such as 'default'. Then tack 'deploy' on to that and use File.listFiles to get the contents of the deploy directory.
-
2. Re: How to programmatically list deploy folders
menegazzo Sep 27, 2010 9:45 AM (in response to peterj)Simple and fast, but rely on fact that deploy folder is always named "deploy", wich is not the case.
-
3. Re: How to programmatically list deploy folders
peterj Sep 27, 2010 11:33 AM (in response to menegazzo)That's true, but I always prefer a simple solution, especially if it fits 99.99% of the cases (with the hundreds of the people I've helped with JBoss AS, I can count on one hand the number who has used a deploiy directory other than 'deploy', and still have fingers left over). Though I am willing to admit that your situation might be one of the excpetions (is it?).
I did consider how to ask for the deploy directory, but that gets a little tricky. In 4.2.3 and earlier, you could ask the URLDeploymentScanner MBean. In 5.0.0 and later you have to ask a microcontainer bean. I guess you could declare a bean in you own *-jboss-beans.xml file and have that bean reference the BootstrapProfileFactory bean, which you could then query to determine the list of deployment directories.
-
4. Re: How to programmatically list deploy folders
peterj Sep 27, 2010 11:31 AM (in response to peterj)And I should mention that the fun part in 5.x is to figure out where the deploy directory declaration is hiding - it changes in every release. The BootstrapProfileFactory bean location is for 5.1.0 only, for 5.0.1 it is VFSDeploymentScanner.
-
5. Re: How to programmatically list deploy folders
menegazzo Sep 29, 2010 3:06 PM (in response to peterj)Yes, we are part of 0.01%. I must admit, after all these args, is better to adopt your solution. I will create a simple service/interface to do this, to not generate coupling. Its hard, but i agree thanks for helping