commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Diggory" <mdigg...@gmail.com>
Subject [configuration] Variable Interpolation doesn't happen in subset() and configurationAt()
Date Thu, 30 Nov 2006 16:29:39 GMT
I'm trying to use variable interpolation in version 1.3 I'm unsure of the
behavior with Sub-configurations. I'm wondering if interpolation should work
in these as well (i.e. using the entire configuration to interpolate
against. For instance if I have

base.dir=/home/foo

test.absolute.dir.x=${base.dir}/mypath
test.absolute.dir.y=${base.dir}/mypath1
test.absolute.dir.z=${base.dir}/mypath2

If I call something like:

Configuration config = configuration.configurationAt("test.absolute.dir");
for (Iterator iter = config.getKeys(); iter.hasNext();)
        {
            String key = (String) iter.next();
            System.out.println(key + "=" + config.getString(key));
        }

this prints out

x=${base.dir}/mypath
y=${base.dir}/mypath1
z=${base.dir}/mypath2

I was naively expecting

x=/home/foo/mypath
y=/home/foo/mypath1
z=/home/foo/mypath2

Thoughts?
Mark

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message