[ http://issues.apache.org/jira/browse/CONFIGURATION-104?page=all ]
Oliver Heger resolved CONFIGURATION-104. ---------------------------------------- Resolution: Fixed A new class PropertiesConfigurationLayout was added. Objects of this class are associated with PropertiesConfiguration instances. They are able to preserve many structure related aspects of a properties file. Please have a look if this class fits your needs. > [configuration] Preserve file structure (line comments) when re-saving > properties file > -------------------------------------------------------------------------------------- > > Key: CONFIGURATION-104 > URL: http://issues.apache.org/jira/browse/CONFIGURATION-104 > Project: Commons Configuration > Issue Type: Bug > Environment: Operating System: other > Platform: Other > Reporter: Oded Noam > Assigned To: Oliver Heger > Attachments: preserve-comments-patch, preserve-comments-patch-java1.3 > > > This bug applies when an application allows both manual editing of its > configuration files, and manipulation of the configuration via software. > When > saving the configuration file after changing, its file structure - file, > section and line comments - will all be lost. Next time a human tries to edit > the configuration file, all property documentation will be lost. > I have created a fix for this problem, applicable to PropertiesConfiguration > and XMLPropertiesConfiguration. The fix allows these classes to preserve a > list of comment lines preceding each property line. By default, comments are > not preserved; in case the comment preservation is required, it should be > enabled prior to loading the configuration file using: > AbstractFileConfiguration.setDefaultPreserveComments(true); > The fix is implemented and tested, attached as a patch file to this bug. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]