Read the whole file into a String, update the String and write out the updated String replacing the existing file.