commons-configuration v1.10 を使用しており、このクラスを使用PropertiesConfiguration
してアプリケーションのプロパティを読み込んでいます。カンマを含むプロパティがありますが、それを読み込むと区切られてしまい、カンマをなくす方法がわかりません。
プロパティをすべて順番にコンマを含めて吐き出しますが、問題になっているのは、「[」と「]」で囲まれているためです。
AbstractConfiguration
には区切りを無効にする関数 がsetDelimiterParsingDisabled()
ありますが、プロパティ ファイルを読み取るためにそれを実装したクラスが見つかりませんでした。
private static String readProperty(String property) {
try {
Configuration configuration = new PropertiesConfiguration(propertiesFile);
return configuration.getProperty(property).toString();
}
catch(ConfigurationException e) {
System.out.println("Issue reading " + property + " property");
e.printStackTrace();
System.exit(1);
return "";
}
}