[Configuration] Optional Includes in Properties files

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[Configuration] Optional Includes in Properties files

garydgregory
Hi All:

Right now, if you uses an 'include' in a properties file and that file is
missing, the rest of the file does not load.

I'd like to add a 'includesoptional' where nothing happens if the file is
missing.

Any objections or thoughts on a better name?

Gary
Reply | Threaded
Open this post in threaded view
|

Re: [Configuration] Optional Includes in Properties files

Gilles Sadowski-2
Le lun. 20 mai 2019 à 14:51, Gary Gregory <[hidden email]> a écrit :
>
> Hi All:
>
> Right now, if you uses an 'include' in a properties file and that file is
> missing, the rest of the file does not load.

IMHO, it seems like a bug.

If the contents is required, failure should occur because of that
(later, according to code logic), not because the file is missing.

> I'd like to add a 'includesoptional' where nothing happens if the file is
> missing.
>
> Any objections or thoughts on a better name?

includeifexist
(?)

Gilles

>
> Gary

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Configuration] Optional Includes in Properties files

garydgregory
On Mon, May 20, 2019 at 9:16 AM Gilles Sadowski <[hidden email]>
wrote:

> Le lun. 20 mai 2019 à 14:51, Gary Gregory <[hidden email]> a
> écrit :
> >
> > Hi All:
> >
> > Right now, if you uses an 'include' in a properties file and that file is
> > missing, the rest of the file does not load.
>
> IMHO, it seems like a bug.
>
> If the contents is required, failure should occur because of that
> (later, according to code logic), not because the file is missing.
>
> > I'd like to add a 'includesoptional' where nothing happens if the file is
> > missing.
> >
> > Any objections or thoughts on a better name?
>
> includeifexist
> (?)
>

Maybe; with includeoptional, I was imitating
https://httpd.apache.org/docs/2.4/mod/core.html#includeoptional

Gary


>
> Gilles
>
> >
> > Gary
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [Configuration] Optional Includes in Properties files

sebb-2-2
On Mon, 20 May 2019 at 14:58, Gary Gregory <[hidden email]> wrote:

>
> On Mon, May 20, 2019 at 9:16 AM Gilles Sadowski <[hidden email]>
> wrote:
>
> > Le lun. 20 mai 2019 à 14:51, Gary Gregory <[hidden email]> a
> > écrit :
> > >
> > > Hi All:
> > >
> > > Right now, if you uses an 'include' in a properties file and that file is
> > > missing, the rest of the file does not load.
> >
> > IMHO, it seems like a bug.
> >
> > If the contents is required, failure should occur because of that
> > (later, according to code logic), not because the file is missing.
> >
> > > I'd like to add a 'includesoptional' where nothing happens if the file is
> > > missing.
> > >
> > > Any objections or thoughts on a better name?
> >
> > includeifexist
> > (?)
> >
>
> Maybe; with includeoptional, I was imitating
> https://httpd.apache.org/docs/2.4/mod/core.html#includeoptional

I find includeoptional marginally easier to read.
And it avoids having to remember if the spelling is includeifexist or
includeifexists

But I agree with Gilles that it seems like a bug if a missing include
does not throw an error.

> Gary
>
>
> >
> > Gilles
> >
> > >
> > > Gary
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Configuration] Optional Includes in Properties files

Oliver Heger-3


Am 20.05.19 um 16:19 schrieb sebb:

> On Mon, 20 May 2019 at 14:58, Gary Gregory <[hidden email]> wrote:
>>
>> On Mon, May 20, 2019 at 9:16 AM Gilles Sadowski <[hidden email]>
>> wrote:
>>
>>> Le lun. 20 mai 2019 à 14:51, Gary Gregory <[hidden email]> a
>>> écrit :
>>>>
>>>> Hi All:
>>>>
>>>> Right now, if you uses an 'include' in a properties file and that file is
>>>> missing, the rest of the file does not load.
>>>
>>> IMHO, it seems like a bug.
>>>
>>> If the contents is required, failure should occur because of that
>>> (later, according to code logic), not because the file is missing.
>>>
>>>> I'd like to add a 'includesoptional' where nothing happens if the file is
>>>> missing.
>>>>
>>>> Any objections or thoughts on a better name?
>>>
>>> includeifexist
>>> (?)
>>>
>>
>> Maybe; with includeoptional, I was imitating
>> https://httpd.apache.org/docs/2.4/mod/core.html#includeoptional
>
> I find includeoptional marginally easier to read.
> And it avoids having to remember if the spelling is includeifexist or
> includeifexists
>
> But I agree with Gilles that it seems like a bug if a missing include
> does not throw an error.

Note that the builder mechanism for combined configuration sources
already supports optional configuration sources. Details can be found in
the user's guide [1].

Oliver

[1]
https://commons.apache.org/proper/commons-configuration/userguide/howto_combinedbuilder.html#Optional_configuration_sources

>
>> Gary
>>
>>
>>>
>>> Gilles
>>>
>>>>
>>>> Gary
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Configuration] Optional Includes in Properties files

garydgregory
On Mon, May 20, 2019 at 12:03 PM Oliver Heger <[hidden email]>
wrote:

>
>
> Am 20.05.19 um 16:19 schrieb sebb:
> > On Mon, 20 May 2019 at 14:58, Gary Gregory <[hidden email]>
> wrote:
> >>
> >> On Mon, May 20, 2019 at 9:16 AM Gilles Sadowski <[hidden email]>
> >> wrote:
> >>
> >>> Le lun. 20 mai 2019 à 14:51, Gary Gregory <[hidden email]> a
> >>> écrit :
> >>>>
> >>>> Hi All:
> >>>>
> >>>> Right now, if you uses an 'include' in a properties file and that
> file is
> >>>> missing, the rest of the file does not load.
> >>>
> >>> IMHO, it seems like a bug.
> >>>
> >>> If the contents is required, failure should occur because of that
> >>> (later, according to code logic), not because the file is missing.
> >>>
> >>>> I'd like to add a 'includesoptional' where nothing happens if the
> file is
> >>>> missing.
> >>>>
> >>>> Any objections or thoughts on a better name?
> >>>
> >>> includeifexist
> >>> (?)
> >>>
> >>
> >> Maybe; with includeoptional, I was imitating
> >> https://httpd.apache.org/docs/2.4/mod/core.html#includeoptional
> >
> > I find includeoptional marginally easier to read.
> > And it avoids having to remember if the spelling is includeifexist or
> > includeifexists
> >
> > But I agree with Gilles that it seems like a bug if a missing include
> > does not throw an error.
>
> Note that the builder mechanism for combined configuration sources
> already supports optional configuration sources. Details can be found in
> the user's guide [1].
>

Thank you for the pointer Oliver.

I think my team really needs includeoptional as loading an XML file instead
of our property file would require us to produce this XML file to being
with which is out of bounds for us since our toolchain would have to be in
the loop.

I'll create a JIRA and so on.

Gary


> Oliver
>
> [1]
>
> https://commons.apache.org/proper/commons-configuration/userguide/howto_combinedbuilder.html#Optional_configuration_sources
>
> >
> >> Gary
> >>
> >>
> >>>
> >>> Gilles
> >>>
> >>>>
> >>>> Gary
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: [hidden email]
> >>> For additional commands, e-mail: [hidden email]
> >>>
> >>>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [Configuration] Optional Includes in Properties files

garydgregory
Hi All:

Please review:

- https://github.com/apache/commons-configuration/pull/27
- https://issues.apache.org/jira/browse/CONFIGURATION-745

Thank you,
Gary


On Mon, May 20, 2019 at 8:15 PM Gary Gregory <[hidden email]> wrote:

> On Mon, May 20, 2019 at 12:03 PM Oliver Heger <
> [hidden email]> wrote:
>
>>
>>
>> Am 20.05.19 um 16:19 schrieb sebb:
>> > On Mon, 20 May 2019 at 14:58, Gary Gregory <[hidden email]>
>> wrote:
>> >>
>> >> On Mon, May 20, 2019 at 9:16 AM Gilles Sadowski <[hidden email]>
>> >> wrote:
>> >>
>> >>> Le lun. 20 mai 2019 à 14:51, Gary Gregory <[hidden email]> a
>> >>> écrit :
>> >>>>
>> >>>> Hi All:
>> >>>>
>> >>>> Right now, if you uses an 'include' in a properties file and that
>> file is
>> >>>> missing, the rest of the file does not load.
>> >>>
>> >>> IMHO, it seems like a bug.
>> >>>
>> >>> If the contents is required, failure should occur because of that
>> >>> (later, according to code logic), not because the file is missing.
>> >>>
>> >>>> I'd like to add a 'includesoptional' where nothing happens if the
>> file is
>> >>>> missing.
>> >>>>
>> >>>> Any objections or thoughts on a better name?
>> >>>
>> >>> includeifexist
>> >>> (?)
>> >>>
>> >>
>> >> Maybe; with includeoptional, I was imitating
>> >> https://httpd.apache.org/docs/2.4/mod/core.html#includeoptional
>> >
>> > I find includeoptional marginally easier to read.
>> > And it avoids having to remember if the spelling is includeifexist or
>> > includeifexists
>> >
>> > But I agree with Gilles that it seems like a bug if a missing include
>> > does not throw an error.
>>
>> Note that the builder mechanism for combined configuration sources
>> already supports optional configuration sources. Details can be found in
>> the user's guide [1].
>>
>
> Thank you for the pointer Oliver.
>
> I think my team really needs includeoptional as loading an XML file
> instead of our property file would require us to produce this XML file to
> being with which is out of bounds for us since our toolchain would have to
> be in the loop.
>
> I'll create a JIRA and so on.
>
> Gary
>
>
>> Oliver
>>
>> [1]
>>
>> https://commons.apache.org/proper/commons-configuration/userguide/howto_combinedbuilder.html#Optional_configuration_sources
>>
>> >
>> >> Gary
>> >>
>> >>
>> >>>
>> >>> Gilles
>> >>>
>> >>>>
>> >>>> Gary
>> >>>
>> >>> ---------------------------------------------------------------------
>> >>> To unsubscribe, e-mail: [hidden email]
>> >>> For additional commands, e-mail: [hidden email]
>> >>>
>> >>>
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [hidden email]
>> > For additional commands, e-mail: [hidden email]
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: [Configuration] Optional Includes in Properties files

garydgregory
On Mon, May 20, 2019 at 9:01 PM Gary Gregory <[hidden email]> wrote:

> Hi All:
>
> Please review:
>
> - https://github.com/apache/commons-configuration/pull/27
> - https://issues.apache.org/jira/browse/CONFIGURATION-745
>

If there is no push back here, I will merge later today.

I also plan on creating a release candidate.

Gary


>
> Thank you,
> Gary
>
>
> On Mon, May 20, 2019 at 8:15 PM Gary Gregory <[hidden email]>
> wrote:
>
>> On Mon, May 20, 2019 at 12:03 PM Oliver Heger <
>> [hidden email]> wrote:
>>
>>>
>>>
>>> Am 20.05.19 um 16:19 schrieb sebb:
>>> > On Mon, 20 May 2019 at 14:58, Gary Gregory <[hidden email]>
>>> wrote:
>>> >>
>>> >> On Mon, May 20, 2019 at 9:16 AM Gilles Sadowski <[hidden email]
>>> >
>>> >> wrote:
>>> >>
>>> >>> Le lun. 20 mai 2019 à 14:51, Gary Gregory <[hidden email]> a
>>> >>> écrit :
>>> >>>>
>>> >>>> Hi All:
>>> >>>>
>>> >>>> Right now, if you uses an 'include' in a properties file and that
>>> file is
>>> >>>> missing, the rest of the file does not load.
>>> >>>
>>> >>> IMHO, it seems like a bug.
>>> >>>
>>> >>> If the contents is required, failure should occur because of that
>>> >>> (later, according to code logic), not because the file is missing.
>>> >>>
>>> >>>> I'd like to add a 'includesoptional' where nothing happens if the
>>> file is
>>> >>>> missing.
>>> >>>>
>>> >>>> Any objections or thoughts on a better name?
>>> >>>
>>> >>> includeifexist
>>> >>> (?)
>>> >>>
>>> >>
>>> >> Maybe; with includeoptional, I was imitating
>>> >> https://httpd.apache.org/docs/2.4/mod/core.html#includeoptional
>>> >
>>> > I find includeoptional marginally easier to read.
>>> > And it avoids having to remember if the spelling is includeifexist or
>>> > includeifexists
>>> >
>>> > But I agree with Gilles that it seems like a bug if a missing include
>>> > does not throw an error.
>>>
>>> Note that the builder mechanism for combined configuration sources
>>> already supports optional configuration sources. Details can be found in
>>> the user's guide [1].
>>>
>>
>> Thank you for the pointer Oliver.
>>
>> I think my team really needs includeoptional as loading an XML file
>> instead of our property file would require us to produce this XML file to
>> being with which is out of bounds for us since our toolchain would have to
>> be in the loop.
>>
>> I'll create a JIRA and so on.
>>
>> Gary
>>
>>
>>> Oliver
>>>
>>> [1]
>>>
>>> https://commons.apache.org/proper/commons-configuration/userguide/howto_combinedbuilder.html#Optional_configuration_sources
>>>
>>> >
>>> >> Gary
>>> >>
>>> >>
>>> >>>
>>> >>> Gilles
>>> >>>
>>> >>>>
>>> >>>> Gary
>>> >>>
>>> >>> ---------------------------------------------------------------------
>>> >>> To unsubscribe, e-mail: [hidden email]
>>> >>> For additional commands, e-mail: [hidden email]
>>> >>>
>>> >>>
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: [hidden email]
>>> > For additional commands, e-mail: [hidden email]
>>> >
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
Reply | Threaded
Open this post in threaded view
|

Re: [Configuration] Optional Includes in Properties files

garydgregory
On Tue, May 21, 2019 at 7:21 AM Gary Gregory <[hidden email]> wrote:

> On Mon, May 20, 2019 at 9:01 PM Gary Gregory <[hidden email]>
> wrote:
>
>> Hi All:
>>
>> Please review:
>>
>> - https://github.com/apache/commons-configuration/pull/27
>> - https://issues.apache.org/jira/browse/CONFIGURATION-745
>>
>
> If there is no push back here, I will merge later today.
>

PR merged to git master.

Gary


>
> I also plan on creating a release candidate.
>
> Gary
>
>
>>
>> Thank you,
>> Gary
>>
>>
>> On Mon, May 20, 2019 at 8:15 PM Gary Gregory <[hidden email]>
>> wrote:
>>
>>> On Mon, May 20, 2019 at 12:03 PM Oliver Heger <
>>> [hidden email]> wrote:
>>>
>>>>
>>>>
>>>> Am 20.05.19 um 16:19 schrieb sebb:
>>>> > On Mon, 20 May 2019 at 14:58, Gary Gregory <[hidden email]>
>>>> wrote:
>>>> >>
>>>> >> On Mon, May 20, 2019 at 9:16 AM Gilles Sadowski <
>>>> [hidden email]>
>>>> >> wrote:
>>>> >>
>>>> >>> Le lun. 20 mai 2019 à 14:51, Gary Gregory <[hidden email]>
>>>> a
>>>> >>> écrit :
>>>> >>>>
>>>> >>>> Hi All:
>>>> >>>>
>>>> >>>> Right now, if you uses an 'include' in a properties file and that
>>>> file is
>>>> >>>> missing, the rest of the file does not load.
>>>> >>>
>>>> >>> IMHO, it seems like a bug.
>>>> >>>
>>>> >>> If the contents is required, failure should occur because of that
>>>> >>> (later, according to code logic), not because the file is missing.
>>>> >>>
>>>> >>>> I'd like to add a 'includesoptional' where nothing happens if the
>>>> file is
>>>> >>>> missing.
>>>> >>>>
>>>> >>>> Any objections or thoughts on a better name?
>>>> >>>
>>>> >>> includeifexist
>>>> >>> (?)
>>>> >>>
>>>> >>
>>>> >> Maybe; with includeoptional, I was imitating
>>>> >> https://httpd.apache.org/docs/2.4/mod/core.html#includeoptional
>>>> >
>>>> > I find includeoptional marginally easier to read.
>>>> > And it avoids having to remember if the spelling is includeifexist or
>>>> > includeifexists
>>>> >
>>>> > But I agree with Gilles that it seems like a bug if a missing include
>>>> > does not throw an error.
>>>>
>>>> Note that the builder mechanism for combined configuration sources
>>>> already supports optional configuration sources. Details can be found in
>>>> the user's guide [1].
>>>>
>>>
>>> Thank you for the pointer Oliver.
>>>
>>> I think my team really needs includeoptional as loading an XML file
>>> instead of our property file would require us to produce this XML file to
>>> being with which is out of bounds for us since our toolchain would have to
>>> be in the loop.
>>>
>>> I'll create a JIRA and so on.
>>>
>>> Gary
>>>
>>>
>>>> Oliver
>>>>
>>>> [1]
>>>>
>>>> https://commons.apache.org/proper/commons-configuration/userguide/howto_combinedbuilder.html#Optional_configuration_sources
>>>>
>>>> >
>>>> >> Gary
>>>> >>
>>>> >>
>>>> >>>
>>>> >>> Gilles
>>>> >>>
>>>> >>>>
>>>> >>>> Gary
>>>> >>>
>>>> >>>
>>>> ---------------------------------------------------------------------
>>>> >>> To unsubscribe, e-mail: [hidden email]
>>>> >>> For additional commands, e-mail: [hidden email]
>>>> >>>
>>>> >>>
>>>> >
>>>> > ---------------------------------------------------------------------
>>>> > To unsubscribe, e-mail: [hidden email]
>>>> > For additional commands, e-mail: [hidden email]
>>>> >
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>