How to write multiple line property value using PropertiesConfiguration?

前端 未结 4 2051
面向向阳花
面向向阳花 2020-12-08 03:53

I have a properties file with a property with a List value (comma separated), how to write this property in a multi-line ? (backslash after the comma)?

I can\'t find

4条回答
  •  粉色の甜心
    2020-12-08 04:17

    You need to combine the \n character inside the content and the line continuation escape (\ at end of line) to get a multi line property actually be represented in the properties file and in the returned value:

    KEY1=first line\n\
    second line\n\
    last line
    KEY2=another key
    

    Not sure if commons-configuration can be configured to actually use this syntax for writing.

提交回复
热议问题