Emmanuel Bourg <[EMAIL PROTECTED]> writes:
>Henning P. Schmiedehausen wrote:
>> with this class gone from the 1.0 release; how am I supposed to load a
>> file from the classpath? just use new PropertiesConfiguration(file)
>> and hope that ConfigurationUtils.locate() doesn't match another file
>> by accident?
>Hi, yes that's the purpose of the locate() method. Alternatively you can
>provide your own URL if you want to be sure the right file is selected.
>Regarding the locate() method I hesitated to implement a more generic
>design but I didn't want to start with an over designed solution. The
>idea was to introduce a Locator interface, a Locator implements a
>strategy for finding a resource:
>public interface Locator {
> URL locate(String basepath, String filename);
>}
I don't think, this is overengineered. Are you sure about URL locate?
I'd probably go for InputStream locate().
>Then we would have a ClassPathLocator, a HomeDirectoryLocator, a
>ChainedLocator, etc... A default locator would be provided but could be
>overridden, thus you could implement your customized strategy.
Hm. I probably would like this solution better than the current (which
reminds me of the way that commons-logging tries to find its log
APIs). We could use current as the default and make the others
pluggable. (and add a few C'tors which accept a Locator object)
Regards
Henning
--
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH
[EMAIL PROTECTED] +49 9131 50 654 0 http://www.intermeta.de/
RedHat Certified Engineer -- Jakarta Turbine Development -- hero for hire
Linux, Java, perl, Solaris -- Consulting, Training, Development
What is more important to you...
[ ] Product Security
or [ ] Quality of Sales and Marketing Support
-- actual question from a Microsoft customer survey
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]