Class FileDeleteTransactionRunnable


  • public class FileDeleteTransactionRunnable
    extends StartableTransactionRunnable<TransactionRunnable>
    A TransactionRunnable for deleting a file safely. The operation can be rolled back even after the onCommit() function is called. It is only final when the onComplete function is called.
    Since:
    3.0M2
    Version:
    $Id: e57fe7e5a1eee5d6734ee4ede2c2070407b0e98a $
    • Constructor Detail

      • FileDeleteTransactionRunnable

        public FileDeleteTransactionRunnable​(File toDelete,
                                             File backupFile,
                                             ReadWriteLock lock)
        The Constructor.
        Parameters:
        toDelete - the file to delete.
        backupFile - a temporary file, this should not contain anything important as it will be deleted and must not be altered while the operation is running. This will contain whatever was in the toDelete file prior, just in case onRollback must be called.
        lock - a ReadWriteLock whose writeLock will be locked as the beginning of the process and unlocked when complete.