org.apache.commons.configuration.INIConfiguration:带点(段)的节名

时间:2015-06-10 08:35:51

标签: java configuration ini

我有一个ini配置,我用org.apache.commons.configuration.INIConfiguration读取。这很好用。 但是现在我的配置中有一个带点(perod)的sectionname。

[fineSection]
fineKey = fineValue

[worry.Section]
worryKey = worryValue 

这是我的代码:

String content = getMyConfiguration();
INIConfiguration iniConfiguration = new INIConfiguration();
iniConfiguration.load(new ByteArrayInputStream(content.getBytes()));
Set<?> sections = iniConfiguration.getSections();

我得到了

sections = [fineSection, worry].

但我需要

sections = [fineSection, worry.Section].

如何解决这个问题,有可能吗?

谢谢,托马斯

1 个答案:

答案 0 :(得分:0)

使用Commons Configuration 2.2版