apache commons配置加载属性直到“,”字符 [英] apache commons configuration loads property until "," character
本文介绍了apache commons配置加载属性直到“,”字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从属性文件加载配置(apache commons配置)。我的程序是:
I want to load configuration (apache commons configuration) from a properties file. My program is:
PropertiesConfiguration pc = new PropertiesConfiguration("my.properties");
System.out.println(pc.getString("myValue"));
在 my.properties
我有
myValue=value,
用逗号
当我运行程序时,输出是 value
,而不是值,逗号
。看起来值加载到,
字符。
When I run program the output is value
, not value, with comma
. Looks like value is loaded until ,
character.
任何想法?
推荐答案
检查 Javadoc 。您必须setDelimiterParsingDisabled(true)才能禁用解析属性列表。
Check Javadoc. You have to setDelimiterParsingDisabled(true) to disable parsing list of properties.
这篇关于apache commons配置加载属性直到“,”字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文