apache-commons-config

How to get list of properties using apache.commons

大城市里の小女人 提交于 2019-12-05 21:08:09
问题 I need to get the list of properties which are in the .properties file. For example, if have the following .properties file: users.admin.keywords = admin users.admin.regexps = test-5,test-7 users.admin.rules = users.admin.keywords,users.admin.regexps users.root.keywords = newKeyWordq users.root.regexps = asdasd,\u0432[\u044By][\u0448s]\u043B\u0438\u0442[\u0435e] users.root.rules = users.root.keywords,users.root.regexps,rules.creditcards users.guest.keywords = guest users.guest.regexps = *

How to load multiple configuration files using apache common configuration(java)

≯℡__Kan透↙ 提交于 2019-12-03 17:13:14
问题 I have a main conf file which I load using apache common configuration class. I have a requirement where user can specify a conf file and values in those file will override the values in main conf. Please suggest me how we can do that in apache common configuration class or any other open source class to achieve this. Thanks in advance 回答1: I think you want something similar to the mechanism described here: CompositeConfiguration config = new CompositeConfiguration(); config.addConfiguration

Guice and general application configuration

佐手、 提交于 2019-12-03 08:35:34
问题 For a monitoring software written in Java I consider using Google Guice as DI provider. The project needs to load its configuration from an external resource (file or database). The application is designed to run in standalone mode or in a servlet container. At the moment the configuration does not contain bindings or parameters for dependency injection, only some global application settings (JDBC connection definitions and associated database management/monitoring objects). I see two options

Guice and general application configuration

丶灬走出姿态 提交于 2019-12-03 00:09:25
For a monitoring software written in Java I consider using Google Guice as DI provider. The project needs to load its configuration from an external resource (file or database). The application is designed to run in standalone mode or in a servlet container. At the moment the configuration does not contain bindings or parameters for dependency injection, only some global application settings (JDBC connection definitions and associated database management/monitoring objects). I see two options: to use another library, for example Apache Commons Configuration , which supports file and JDBC

Very simple Apache-commons configuration example throws NoClassDefFoundError

徘徊边缘 提交于 2019-11-30 17:17:19
I'm trying to test a very simple example given in the Apache-commons configuration library user's guide regarding declaring and creating beans. I copied the code in the example almost word by word, and yet I'm getting a NoClassDefFoundError exception. Here is the xml file I'm using - windowcongif.xml : <?xml version="1.0" encoding="ISO-8859-1" ?> <config> <gui> <windowManager config-class="test.DefaultWindowManager" closable="false" resizable="true" defaultWidth="400" defaultHeight="250"> </windowManager> </gui> </config> Here is the code in the file WindowManager.java : package test; public

How to write multiple line property value using PropertiesConfiguration?

假如想象 提交于 2019-11-28 06:07:35
I have a properties file with a property with a List value (comma separated), how to write this property in a multi-line ? (backslash after the comma)? I can't find anything about this or at least about escaping comma to comma and backslash. If you mean the following; that just relies on backslash + end-of-line. I just found it documented in: http://docs.oracle.com/javase/6/docs/api/java/util/Properties.html primes = 2,\ 3,\ 5,\ 7,\ 11 Check the User Guide for Properties files : Special Characters and Escaping : If you need a special character in a property like a line feed, a tabulation or an