I think the only dissention that I would have is the conf.getSection... I
think that one of the key points of Configuration is that the implementors
all work via the Configuration interface.. A user of IniFileConfiguration
is going to expect to do something like getString("Section 1.key_a") or
something along that means..
It seems like how you would do it is
IniFileConfiguration conf = new IniFileConfiguration(filePath);
Configuration section1 = conf.subset("Section 1");
String key_a = section1.getString("key_a");
conf.setProperty("Section 1.key_b","key_b_value");
String key_b = conf.getSTring("Section 1.key_b");
I think that you have to implement this to support working with
CompositeConfiguration, SubsetConfiguration.
Now, if beyond the Configuration interface you had a couple helper methods
specific to IniFileConfiguration, then that would be okay I think... But,
I think it really has to implement Configuration.
Eric
> -----Original Message-----
> From: Inger, Matthew [mailto:[EMAIL PROTECTED]
> Sent: Saturday, July 24, 2004 12:03 AM
> To: 'Jakarta Commons Developers List'
> Subject: [Configuration]IniFileConfiguration
>
>
> Barring any objections, I'd like to commit the IniFileConfiguration
> classes (and test code and data) to CVS. Here's a basic summary of
> how it would be used:
>
> IniFileConfiguration conf = new IniFileConfiguration(filePath);
>
> IniSectionConfiguration section1 = conf.getSection("Section 1");
> String key_a = section1.getString("key_a");
>
> String key_b =
> conf.getString(IniFileConfiguration.createKey("Section 1",
>
> "key_b"));
>
> conf.save(newFilePath);
>
> Basically, it behaves like a configuration object, exception that the keys
> are a special format containing the section name and key name:
> [section]key
> and there are special methods for retrieving specific sections.
>
> Any dissention?
>
> ---------------------------------------------------------------------
> 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]