Wabner, Thomas (EXT) wrote:
Hi again,

I have solved this problem for myself.

After reading the complete documentation I have found the 
ConfigurationUtils#copy() method. This method does what I want ;-)

- waffel

Hello,

ConfigurationUtils#copy() is certainly a good solution for simple use cases.

For more complex scenarios DefaultConfigurationBuilder might be an alternative. This class allows you to specify an arbitrary number of configurations to be loaded and how they should be combined. The class is fully covered in the user guide [1].

Oliver

[1] http://commons.apache.org/configuration/userguide/howto_configurationbuilder.html#Using_DefaultConfigurationBuilder


Mit freundlichem Gruß / Best regards


Thomas Wabner

Siemens AG
Automation and Drives, A&D CoC Sales Configuration

SPICE - Service & Support
Tel. : +49 (341) 4470-657
mailto:[EMAIL PROTECTED]
https://workspace.automation.siemens.com/alias/config

Siemens Aktiengesellschaft: Chairman of the Supervisory Board: Gerhard Cromme;
Managing Board: Peter Löscher, Chairman, President and Chief Executive Officer;
Johannes Feldmayer, Heinrich Hiesinger, Joe Kaeser, Rudi Lamprecht, Eduardo Montes, Juergen Radomski, Erich R. Reinhardt, Hermann Requardt, Uriel J. Sharef, Klaus Wucherer;
Registered offices: Berlin and Munich;
Commercial registries: Berlin Charlottenburg, HRB 12300, Munich, HRB 6684
WEEE-Reg.-No. DE 23691322

-----Original Message-----
From: Wabner, Thomas (EXT) Sent: Dienstag, 4. September 2007 17:54
To: [EMAIL PROTECTED]
Subject: [commons-configuration] - overloading a properties configuration

Hi,

I have following problem:

Loading file A.property which includes follow example properties:

Test1=test1

Test2=test2

The I have a file B.property which have properties:

Test2=test3

What I want is to first load file A.properties and then "overloading" the file 
B.properties. The resulting configuration object should look like

Test1=test1

Test2=test3

But if I use the load() method from the PropertiesConfiguration I got a 
configuration object which looks like

Test1=test1

Test2=test2, test3

Now the question: If there is another method or trigger do not append the 
second property but to override it?

Many thanks

- waffel

Mit freundlichem Gruß / Best regards

Thomas Wabner

Siemens AG
Automation and Drives, A&D CoC Sales Configuration

SPICE - Service & Support

Tel.    : +49 (341) 4470-657
mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> <http://www.siemens.com/automation> https://workspace.automation.siemens.com/alias/config <https://workspace.automation.siemens.com/alias/config>
Siemens Aktiengesellschaft: Chairman of the Supervisory Board: Gerhard Cromme;
Managing Board: Peter Löscher, Chairman, President and Chief Executive Officer;
Johannes Feldmayer, Heinrich Hiesinger, Joe Kaeser, Rudi Lamprecht, Eduardo Montes, Juergen Radomski, Erich R. Reinhardt, Hermann Requardt, Uriel J. Sharef, Klaus Wucherer;
Registered offices: Berlin and Munich;
Commercial registries: Berlin Charlottenburg, HRB 12300, Munich, HRB 6684
WEEE-Reg.-No. DE 23691322


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to