The FileUtils.writeStringToFile(fileName, text) function of Apache Commons I/O overwrites previous text in a file. I would like to append data to my file. Is there any way I could use Commons I/O for the same? I can do it using normal BufferedWriter from Java but I’m curious regarding the same using Commons I/O.
The FileUtils.writeStringToFile(fileName, text) function of Apache Commons I/O overwrites previous text in a file.
Share
It has been implemented in 2.1 version of Apache IO.
To append string to the file just pass true as an additional parameter in functions:
ex: