Updating a file in java