【问题标题】:org.apache.commons.configuration.INIConfiguration: section name with dot (period)org.apache.commons.configuration.INIConfiguration:带点(句点)的部分名称
【发布时间】:2015-06-10 08:35:50
【问题描述】:

我有一个 ini 配置,我使用 org.apache.commons.configuration.INIConfiguration 读取它。这工作正常。 但现在我的配置中有一个带点(句号)的节名。

[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].

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

谢谢,托马斯

【问题讨论】:

    标签: java configuration ini


    【解决方案1】:

    使用 Commons Configuration 2.2 版

    【讨论】:

    • 请通过添加链接或一些参考来详细说明。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多