[jbosstools-dev] Re: http://jira.jboss.org/jira/browse/JBIDE-1000 - how obtain path to Boss AS server selected configuration folder
Rob Stryker
rob.stryker at redhat.com
Wed Oct 17 22:58:11 EDT 2007
You're going to want to to use the method in JBossServer.class named
getConfigDirectory();
This will at first just get the regular config directory, but if the
user has overridden the config directory of the server in command line
arguments (by using ANY of the command line arguments in
IServerStartupParameters), then it will return that folder instead.
So you can use JBossServer.getConfigDirectory(false) if you *don't* want
to let the server's command line arguments override the server's natural
configuration folder.
Here's a snippet:
IServer server = ... (I assume you have it already)
JBossServer jbs = (JBossServer)server.loadAdapter(JBossServer.class, new
NullProgressMonitor());
if( jbs != null ) {
String configFolder = jbs.getConfigDirectory();
// or, if you don't want to override via the command line args,
// String configFolder = jbs.getConfigDirectory(false);
}
Hope that helps.
Denis Golovin wrote:
> Rob,
>
> can you help us with obtaining full pah to
> <<jboss-as-home>>/server/<<configuration>> folder. We have runtime and
> server manes selected on first wizard page, any code snippet that
> calculate path to configuration folder for runtime would good for us.
>
> Thanks a lot
> Denis.
>
>
More information about the jbosstools-dev
mailing list