You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Michael MATTOX <mi...@verideon.com> on 2004/04/16 10:12:56 UTC

[Configuration] How to get a list of the config files in configuration.xml

I'm implementing an auto-refresh function for the Configuration.  To do this
I need to get a list of the config files listed in configuration.xml.  I
looked through the Javadocs and couldn't find a way to get the list.  Is it
possible with the Configuration API?  If not, should I use the digester
project to read in the list??

Thanks,
Michael Mattox


--
This E-mail is confidential.  It may also be legally privileged.  If you are
not the addressee you may not copy, forward, disclose or use any part of it.
If you have received this message in error, please delete it and all copies
from your system and notify the sender immediately by return E-mail.
Internet communications cannot be guaranteed to be timely, secure, error or
virus-free.  The sender does not accept liability for any errors or omissions.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [Configuration] How to get a list of the config files in configuration.xml

Posted by Oliver Heger <he...@med.uni-marburg.de>.
I think there is no easy way to get the list of files that have been 
loaded through the Configuration API.

It is possible to access the configuration objects that have been loaded 
from the <overload> section (through the CompositeConfiguration object 
returned by ConfigurationFactory). If you cast these to the correct 
types you may be able to query the file name. Configurations loaded from 
the <union> section are combined to a large configuration object and the 
information from which sources it has been constructed is lost.

In short, the Configuration API won't be a great help for you. So as a 
workaround it might make sense to use digester. It is planned to add 
reloading features to Configuration, so such hacks will hopefully become 
unnecessary in the future.

Oliver

Michael MATTOX schrieb:

> I'm implementing an auto-refresh function for the Configuration.  To do this
> I need to get a list of the config files listed in configuration.xml.  I
> looked through the Javadocs and couldn't find a way to get the list.  Is it
> possible with the Configuration API?  If not, should I use the digester
> project to read in the list??
> 
> Thanks,
> Michael Mattox
> 
> 
> --
> This E-mail is confidential.  It may also be legally privileged.  If you are
> not the addressee you may not copy, forward, disclose or use any part of it.
> If you have received this message in error, please delete it and all copies
> from your system and notify the sender immediately by return E-mail.
> Internet communications cannot be guaranteed to be timely, secure, error or
> virus-free.  The sender does not accept liability for any errors or omissions.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 


-- 
Dipl.-Inform. Oliver Heger
Zentrale Informationsverarbeitung (ZIV) / Bereich Anwenderverfahren
Klinikum der Philipps-Universität Marburg
Bunsenstraße 3,
D-35037 Marburg
Tel: +49 6421 28-66592
mailto:oliver.heger@med.uni-marburg.de

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org