commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian E. Dunbar" <>
Subject [Configuration]Missing Jars for Build and Bug with ClassPropertiesConfiguration
Date Thu, 19 Jun 2003 21:27:30 GMT
Item 1:

I was building commons-configuration from scratch and it was having problems
retrieving some of the jar files from ibiblio. I made fixes to the build.xml
file to add/modify some lines to get it to work. My fixed build.xml is

Item 2:

The ClassPropertiesConfiguration seems to only be able to load properties
files from within the package of the class passed into the constructor. I
have been unable to successfully load a properties file from the root of the
classpath by placing a "/" at the beginning of the name (as the source code
indicates one should do). The source code indicates that the Javadoc for
loading resources says that all URL's start with a "/", but I am unable to
find that in the javadoc for ClassLoader and in testing I have been unable
to get ClassLoader to load a file that beings with a "/".

If I am correct, I propose that ClassPropertiesConfiguration be changed as
described below. In my experience it is more likely that properties files
need to be loaded from the root of the classpath then from a specific
package within the classpath (but that is my experience).

Use the classloader of class that is provided by the constructor.
Add a constructor that indicates whether to use relative or absolute.
Change getPropertyStream to utilize the relative or absolute flag.
Add a test case that checks that absolute paths work.

I will gladly submit a patch to do the above if what I propose makes sense.

Brian Dunbar

View raw message