public void deleteOnRollback ( final Collection < File > files ) { addRollbackAction ( new Runnable ( ) { @ Override public void run ( ) { for ( File file : files ) { if ( log . isTraceEnabled ( ) ) log . trace ( "Delete file on transaction rollback: " + file ) ; final boolean success = FileUtils . deleteQuietly ( file ) ; if ( ! success ) log . warn ( "Failed to delete file on transaction rollback: " + file ) ; } } } ) ; }
Adds an action to the transaction to delete a set of files once rollback completes