You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Jamie Guillemette <JM...@hotmail.com> on 2005/04/13 16:18:10 UTC

Re: [Configuration] Changes / fixes for AbstractFileConfiguration

Hi Everyone,

I have been working on a set of fixes for the bugs  that are documented for the AbstractFileConfiguration and I wanted to run a few things by everyone for your input.

Changes to File Loading:

Ive updated the load methods to cascade into one another thus place 99% of the real business logic into a single load method. ( In this case load(URL url) )

thus:
load(String fileName)
woud create a file and from the filename and then pass to 
load(File file)
which would get the URL and pass to
load(URL url)
which would be the primary loading mechanism.

load()
would use the stored url (instance variable) to forward to load(URL url)

This then leads to the saving strategy.

Calling save() will save your current configuration using the existing filename, path ect...
calling save(String fileName) or any other save method that includes a parameter is actually a saveAs type feature.

Updating values

Updating the path and filename values will actually update the internally stored URL.
thus calling setFileName(String name) should cause us to get the basePath.. tack on the fileName and generate the new URL to be used for loading and calling save().
The same logic is applied to setBasePath, setURL ect...
Doing this has ment that the setFileName setBasePath setURL methods now must all throw ConfigurationException(s)
where previously they did not.This is because if we update the instance URL we may encounter a malformedUrlException... 

These changes may also require updating some of our test cases.. ive been reviewing them as I write this email.

Please let me know your thoughts.