commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <ma...@ops.co.at>
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();
try
{
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.

Ciao,
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message