Which is the best common project to put this code ? Configuration or Collections ?

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

Which is the best common project to put this code ? Configuration or Collections ?

mingleizhang
Hello experts


I implemented a tool that can directly read a file name by its current classloader read an Inputstream and returns a java.util.Properties and created two JIRA for this issue as I am not sure which components are the best. The code and the conversions are here: https://github.com/apache/commons-collections/pull/33/files 


Why did I do this ?
Before contributing this,  I searched for a long time for this functionality in Commons Configuration. I could not find it though. I don't want to write it in my way, instead, I want there is an existing lib that implements it. So, that is why I did this contribution.


If I should put it in Commons Configuration. Which package should I put it to?  


Two jira
https://issues.apache.org/jira/browse/CONFIGURATION-674
https://issues.apache.org/jira/browse/COLLECTIONS-664


Thanks
Minglei

Reply | Threaded
Open this post in threaded view
|

Re: Which is the best common project to put this code ? Configuration or Collections ?

Oliver Heger-3
Hi,

thanks for your contribution. See below...

Am 06.11.2017 um 12:48 schrieb mingleizhang:

> Hello experts
>
>
> I implemented a tool that can directly read a file name by its current classloader read an Inputstream and returns a java.util.Properties and created two JIRA for this issue as I am not sure which components are the best. The code and the conversions are here: https://github.com/apache/commons-collections/pull/33/files 
>
>
> Why did I do this ?
> Before contributing this,  I searched for a long time for this functionality in Commons Configuration. I could not find it though. I don't want to write it in my way, instead, I want there is an existing lib that implements it. So, that is why I did this contribution.
>
>
> If I should put it in Commons Configuration. Which package should I put it to?

Commons Configuration does not work with Properties. The project defines
its own configuration interface and provides means to read
configurations in various formats from different sources. The very
specific functionality to load a Properties object does not really fit
here IMHO.

In general, I am not sure whether this code belongs in a low-level and
general-purpose library. It implements a very special use case, to read
a properties file from the class path. It may also be possible to
interpret the passed in string as a path to a file and load the data
from there.

My $0.02
Oliver

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