private void EnsureFileIsNew(string path) { if (_fileSystemAccess.Exists(path)) { _fileSystemAccess.Delete(path); } }
private void DeleteFile(string filePath) { Policy.Handle <IOException>() .Or <UnauthorizedAccessException>() .WaitAndRetry(5, count => TimeSpan.FromMilliseconds(count * 100)) .Execute(() => _fileSystemAccess.Delete(filePath)); }