public void Execute() { if (Directory.Exists(path)) { var temp = TransactionFileUtils.GetTempFileName(string.Empty); TransactionFileUtils.EnsureTempFolderExists(); MoveDirectory(path, temp); backupPath = temp; } }
public override void Execute() { if (File.Exists(path)) { string temp = TransactionFileUtils.GetTempFileName(Path.GetExtension(path)); TransactionFileUtils.EnsureTempFolderExists(); File.Copy(path, temp); backupPath = temp; } File.Delete(path); }