commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 37404] - AbstractFileConfiguration.getFile() returns incorrect file object
Date Tue, 08 Nov 2005 17:18:57 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37404>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37404





------- Additional Comments From pds1602@yahoo.co.uk  2005-11-08 18:18 -------
OK, here is what happens:

AbstractFileConfiguration(String fileName) is called as
AbstractFileConfiguration("mcc.properties"). This calls setPath(fileName) and
then load(). 

setPath(fileName) calls setFile(filename) which is where things start going
wrong because setfile(fileName) calls setFileName() and setBasePath() but we
can't do this because we will only know the actual (i.e. real) basepath *after*
we call load(). So to fix it, load() should update the basepath with the value
from the URL.

The following works for me and can be added either in the constructor or at the
end of the load() method:

URL url = ConfigurationUtils.locate( getBasePath(), getFileName());
setPath(url.toURI().getPath ());


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
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