'Spring change file content

In my Spring Boot application, I want to fill my file with values from my POST REQUEST @RequestBody Parameters. For Example, I have file with several lines and on unknown line I have <parameters> which conatins: <firstParameter>value<firstParameter>

<secondParameter>value<secondParameter>

<thirdParameter>value<thirdParameter>

and in my POST Request I got parameters object with 3 fields:

firstParameter="firstParameter",

secondParameter="secondParameter",

thirdParameter="thirdParameter"

I'm trying to find the easiest way to solve this problem. I've read many articles but couldn't find appropriate one. Any advice would be helpful.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source