commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michiel Kalkman (JIRA)" <>
Subject [jira] Commented: (CONFIGURATION-215) Using relative URLs
Date Sat, 13 Jan 2007 17:13:27 GMT


Michiel Kalkman commented on CONFIGURATION-215:

My apologies for not reacting sooner. This item did get less relevant for me and it "escaped"
from my todo list somehow.

However, I think the item could pop up again in the (near) future, so the item might get relevant
for me again.

The solution you suggest definitely seems okay to me - it would resolve the original issue
I had. 

> Using relative URLs
> -------------------
>                 Key: CONFIGURATION-215
>                 URL:
>             Project: Commons Configuration
>          Issue Type: Improvement
>            Reporter: Michiel Kalkman
>            Priority: Minor
> It would be useful to be able to specify URLs in configuration item values that are relative
to the configuration.
> A sample. I have the following files.
> A/config.xml   which refers to    
> B/specificConfigForB.xml   which refers to
> B/somefile
> Now specifying the location of somefile in specificConfigForB.xml should be possible
using a relative URL, such that it is possible to retrieve the absolute URL of somefile through:
> a) the absolute URL of A/config.xml (e.g.: file:/c:/A/config.xml or http://A/config.xml)
> b) the relative URL of somefile specified in B/specificConfigForB.xml (like <somefile>somefile</somefile>)
> (1) One solution is to make it possible to find the location of the configuration file
that specifies the relative URL. Or more general, commons config should know where a given
configuration item is stored.
> In this case it might be an idea to implement a getURL() on the Configuration interface
which uses:
> 1. the absolute URL of the composite configuration file, (A/config.xml)
> 2. the relative URL to the specfying configuration file, (B/specificConfigForB.xml)
> 3. the relative URL specified (in B/specificConfigForB.xml)
> (2) Another solution is to specify a special meta variable (like ${url}) that can be
used to specify the location of the specifying configuration file wrt the composite configuration
file. E.g. <somefile>${url}/somefile</somefile> would result in ../B/somefile.
> (3) Another solution would be to specify a special attribute to indicate that the value
specified is an URL. Like <somefile type="URL">somefile</somefile>.
> The advantage of solution (1) is that no extra semantics are introduced to the configuration
files. Furthermore, it might possibly be useful in debugging situations. The advantages of
solution (2) is that in this manner other meta variables might be introduced. The disadvantage
of solution (3) is that this one cannot be applied to property files.
> See also

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message