Inspired by http://www.onjava.com/pub/a/onjava/2001/11/07/atomic.html (corrected code http://www.tomlauren.com) I made my own version of a atomic file transaction system for Java. The code accompanying the article is messy and hard to follow, so I took a more object oriented approach, but used the original code as guidance. The system is not finished yet and there are probably bugs.
It's build upon a Command Pattern, where every file action is captured in the Action interface. To expand the system with more actions, implement the Action interface and call registerAction on the Transaction object.