commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Siegmar <oli...@siegmar.net>
Subject Re: [configuration] IniFile support
Date Thu, 14 Apr 2005 09:12:02 GMT
On Thursday 14 April 2005 10:55, Emmanuel Bourg wrote:
> Oliver Siegmar wrote:
> > Does your implementation has default (a.k.a. global, a.k.a. common)
> > section support?
>
> What do you mean by default section exactly ? Currently my
> implementation does the following:

Many application ini files have some kind of default-section. Consider the 
following ini-file:

--------------------------------
[default]
foo = 30
val = 50

[section1]
foo = 10
--------------------------------

In some applications the [default]-section is called [common] or [global] - or 
even different.

One of the constructors could be:

public IniFileConfiguration(String fileName, String defaultSection)


The application could be:

Configuration conf = new IniFileConfiguration("/tmp/test.ini", "default");

conf.getString("section1.foo") -> would return 10
conf.getString("section1.val") -> would return 50


Best,
Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message