Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 50661 invoked from network); 8 Sep 2004 15:25:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 8 Sep 2004 15:25:37 -0000 Received: (qmail 39404 invoked by uid 500); 8 Sep 2004 15:25:33 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 39326 invoked by uid 500); 8 Sep 2004 15:25:32 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 39313 invoked by uid 99); 8 Sep 2004 15:25:32 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [192.18.33.10] (HELO exchange.sun.com) (192.18.33.10) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 08 Sep 2004 08:25:30 -0700 Received: (qmail 17134 invoked by uid 50); 8 Sep 2004 15:27:14 -0000 Date: 8 Sep 2004 15:27:14 -0000 Message-ID: <20040908152714.17133.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: commons-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 31119] New: - [configuration] Configuration type conversion X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31119 [configuration] Configuration type conversion Summary: [configuration] Configuration type conversion Product: Commons Version: Nightly Builds Platform: All OS/Version: All Status: NEW Severity: Enhancement Priority: Other Component: Configuration AssignedTo: commons-dev@jakarta.apache.org ReportedBy: smanux@lfjr.net Currently there is no easy way to change the format used to store file based configurations, a XML configuration cannot be saved as a properties file. One has to copy manually all the properties to a new configuration. Oliver Heger suggested separating the persistence mechanism from the Configuration objects. For example: Configuration config = XMLConfigurationLoader.load("config.xml"); PropertiesConfigurationWriter.save(config, "config.properties"); An other way is to provide a method to copy all the properties from a configuration to another one, either as a copy(Configuration, Configuration) method in ConfigurationUtils, as an addAll(Configuration) method in the Configuration interface or as a special constructor: Configuration config = new XMLConfiguration("config.xml"); Configuration config2 = new PropertiesConfiguration(config); config2.save("config.properties"); --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org