Mi,
this is indeed a bug. Thank you for spotting this. I opened a bugzilla ticket for this issue at
http://issues.apache.org/bugzilla/show_bug.cgi?id=34442
I will have a look at it.
Oliver
Mi Zhang wrote:
Hi,
I am using Configuration but having a problem. I used clear to clear configuration in memory, and then loaded the configuration from file again. After re-loading the XML configuration file, the attributes "mod" of the configuration are all gone. What's the problem or how I can keep the attributes. The following are my code and the output:
System.out.println("----------- Before reload -------------"); XMLConfiguration configuration = new XMLConfiguration(); configuration.load(_configurationFile); ByteArrayOutputStream os = new ByteArrayOutputStream(); configuration.save(os); System.out.println(os.toString());
configuration.clear();
System.out.println("----------- After reload -------------"); configuration.load(_configurationFile); os = new ByteArrayOutputStream(); configuration.save(os); System.out.println(os.toString());
Ouput of the program: ----------- Before reload -------------
<?xml version="1.0" encoding="UTF-8"?>
<servicesConfigurations mod="false">
<log mod="false">file</log>
<proxyHost mod="false">proxy.thedistillery.com.au</proxyHost>
<proxyPort mod="false">3128</proxyPort>
<services mod="false">
<translation mod="false">
<default mod="false">toogletext</default>
<toogletext mod="false">
<log mod="false">change this</log>
</toogletext>
<language-weaver mod="false">
<log mod="false">console</log>
</language-weaver>
</translation>
</services>
</servicesConfigurations>
----------- After reload -------------
<?xml version="1.0" encoding="UTF-8"?>
<servicesConfigurations mod="false">
<log>file</log>
<proxyHost>proxy.thedistillery.com.au</proxyHost>
<proxyPort>3128</proxyPort>
<services>
<translation>
<default>toogletext</default>
<toogletext>
<log>change this</log>
</toogletext>
<language-weaver>
<log>console</log>
</language-weaver>
</translation>
</services>
</servicesConfigurations>
Thanks, Mi
The Distillery Pty Limited ABN 69 080 932 467 PO Box 940, Dickson ACT 2602, AUSTRALIA Phone: +61 2 6272 0200 Fax: +61 2 6262 5151 Web: www.thedistillery.com.au
The Distillery Inc 2111 Wilson Blvd, Suite 700, Arlington, Virginia 22201, USA Phone: +1 703 351 5082 Web: www.thedistilleryinc.com
The Distillery (Europe) Ltd 53 Chandos Place London WC2N 4HS Tel: +44 (0)20 7812 6692 Fax: +44 (0)20 7812 6677
--------------------------------------------------------------------- The information contained in this email and any files attached may be confidential and/or copyrighted information of The Distillery, Third Parties and/or the intended recipient and may be the subject of legal privilege or public interest immunity. You may only reproduce or distribute the material if you are expressly authorised by us to do so. If you are not the intended recipient, any use, disclosure, copying, circulation, forwarding, printing or publication of this message or attached files is strictly forbidden.
If you have received this document in error or are not an intended recipient, please notify the sender and delete from your Inbox and/or system.
The Distillery does not represent or warrant that files attached to
this e-mail are free from computer viruses or other defects and
liability is limited to the resupply (or cost of resupply) of the
attached files.
---------------------------------------------------------------------
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
