commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <>
Subject Re: [vfs] proposal: FileUtils
Date Wed, 02 Feb 2005 14:55:45 GMT
What do you think, if the commands do not chain the next command, but if 
they create a Undo-Command which will be put on a stack and - in case of 
an exception can be processed to "rollback" all commands.
I havent though about it in every detail, but if it is possible it is 
easier to handle - and in the case of a file-manager one could provide a 
undo function.

In pseudo code:

UndoStack tx = new UndoStack();
Backup(tx, ...)
Copy(tx, ...)
Move(tx, ...)
catch (Exception)
  tx.rollback(); <- process undo-stack

But again - [transaction] already do something like this. I think I have 
some time today evening to check this out.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message