public class SaveSession
extends java.lang.Object
Class used to handle safe storage to disk.
Usage: create a SaveSession giving the file to save to, the
encoding, and whether to make a backup. The SaveSession will provide a Writer to store to, which actually
goes to a temporary file. The Writer keeps track of whether all characters could be saved, and if not,
which characters were not encodable.
After saving is finished, the client should close the Writer. If the save should be put into effect, call
commit(), otherwise call cancel(). When cancelling, the temporary file is simply deleted and the target
file remains unchanged. When committing, the temporary file is copied to the target file after making
a backup if requested and if the target file already existed, and finally the temporary file is deleted.
If committing fails, the temporary file will not be deleted.