You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Jason Nah <ha...@yahoo.com.au> on 2004/10/25 10:25:53 UTC

[configuration] Override/additional help

Howdy Folks,

I'm trying to use the inbuilt ConfigurationFactory but
there's a couple of things which i've noted....

1. Is there a way to specify a property file to use
and configuration will ignore the fact that it doesn't
exist? (ie. optional properties could reside in a file
that is optionally included). Right now, it throws
exceptions if the file is missing.
2. If the answer to 2 is no... then is there a way I
can extend this easily? I've had a look at the
ConfigurationFactory class but it looks pretty
involved.
3. Looking at the ConfigurationFactory
implementation... how does configuration, additional
and override work?

Cheers,
Jason

Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [configuration] Override/additional help

Posted by Emmanuel Bourg <sm...@lfjr.net>.
Hi Jason,

Jason Nah wrote:
> Howdy Folks,
> 
> I'm trying to use the inbuilt ConfigurationFactory but
> there's a couple of things which i've noted....
> 
> 1. Is there a way to specify a property file to use
> and configuration will ignore the fact that it doesn't
> exist? (ie. optional properties could reside in a file
> that is optionally included). Right now, it throws
> exceptions if the file is missing.

No, it's a known limitation of [configuration], there is a bug covering 
this issue :

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=31797

> 2. If the answer to 2 is no... then is there a way I
> can extend this easily? I've had a look at the
> ConfigurationFactory class but it looks pretty
> involved.

There is no easy way to do it right now. A possible solution is to hack 
AbstractFileConfiguration.load(String fileName) and fail silently if the 
file is not found.

Emmanuel Bourg

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


RE: [configuration] Override/additional help

Posted by Eric Pugh <ep...@upstate.com>.
There was actually a post about #1.   Check it out, it suggested how to fix
it, because the answer for #2 is no.

,configuration> I think was the old format, where everything was added.  We
changed it to add additional, whichs ands things together, and override,
which allows the first value found to be returned, overriding any value
specified second.

> -----Original Message-----
> From: Jason Nah [mailto:hannosaj@yahoo.com.au]
> Sent: Monday, October 25, 2004 10:26 AM
> To: Jakarta Commons Users List; epugh@upstate.com
> Subject: [configuration] Override/additional help
>
>
> Howdy Folks,
>
> I'm trying to use the inbuilt ConfigurationFactory but
> there's a couple of things which i've noted....
>
> 1. Is there a way to specify a property file to use
> and configuration will ignore the fact that it doesn't
> exist? (ie. optional properties could reside in a file
> that is optionally included). Right now, it throws
> exceptions if the file is missing.
> 2. If the answer to 2 is no... then is there a way I
> can extend this easily? I've had a look at the
> ConfigurationFactory class but it looks pretty
> involved.
> 3. Looking at the ConfigurationFactory
> implementation... how does configuration, additional
> and override work?
>
> Cheers,
> Jason
>
> Find local movie times and trailers on Yahoo! Movies.
> http://au.movies.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org