This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Does it not include the whole new text file (the modified version) ??
Yeah, maybe the BufferedWriter isn't the best solution - try only to use "new PrintWriter(new FileWriter(path, true));" - where the last parameter stands for 'append' - then you can write to the file, after it has been closed, and the append context to the file - but you are not able to 'control' what already has been written (or what the file already contains)
When you use a writer without the 'append' flag, it will start with an empty file all the time.