apache commons 配置加载属性直到“,"特点 [英] apache commons configuration loads property until "," character

查看:20
本文介绍了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,而不是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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆