public async Task DownloadProductFileAsync(long id, string title, string sourceUri, string destination, IStatus status) { if (string.IsNullOrEmpty(sourceUri)) { return; } var sourceUriSansSession = formatUriRemoveSessionDelegate.Format(sourceUri); var destinationUri = formatValidationFileDelegate.Format(sourceUriSansSession); // return early if validation is not expected for this file if (!confirmValidationExpectedDelegate.Confirm(sourceUriSansSession)) { return; } if (fileController.Exists(destinationUri)) { await statusController.InformAsync(status, "Validation file already exists, will not be redownloading"); return; } var validationSourceUri = formatValidationUriDelegate.Format(sourceUri); var downloadValidationFileTask = await statusController.CreateAsync(status, "Download validation file"); await downloadFromUriAsyncDelegate.DownloadFromUriAsync( validationSourceUri, validationDirectoryDelegate.GetDirectory(string.Empty), downloadValidationFileTask); await statusController.CompleteAsync(downloadValidationFileTask); }
public async Task DownloadProductFileAsync(long id, string title, string sourceUri, string destination, IStatus status) { await downloadFromUriAsyncDelegate?.DownloadFromUriAsync( sourceUri, destination, status); }