private async Task <string> DownloadReportingFile(string resultFileDirectory, string resultFileName, bool overwrite, ReportingDownloadOperation operation) { operation.HttpService = HttpService; operation.ZipExtractor = ZipExtractor; operation.FileSystem = FileSystem; CreateWorkingDirectoryIfNeeded(); var localFile = await operation.DownloadResultFileAsync(resultFileDirectory ?? WorkingDirectory, resultFileName, true, overwrite).ConfigureAwait(false); return(localFile); }
private async Task<string> DownloadReportingFile(string resultFileDirectory, string resultFileName, bool overwrite, ReportingDownloadOperation operation) { operation.HttpService = HttpService; operation.ZipExtractor = ZipExtractor; operation.FileSystem = FileSystem; CreateWorkingDirectoryIfNeeded(); var localFile = await operation.DownloadResultFileAsync(resultFileDirectory ?? WorkingDirectory, resultFileName, true, overwrite).ConfigureAwait(false); return localFile; }
/// <summary> /// If for any reason you have to resume from a previous application state, /// you can use an existing download request identifier and use it /// to download the result file. Use TrackAsync to indicate that the application /// should wait to ensure that the download status is completed. /// </summary> /// <param name="requestId"></param> /// <param name="authorizationData"></param> /// <returns></returns> private async Task DownloadResults( string requestId, AuthorizationData authorizationData) { var reportingDownloadOperation = new ReportingDownloadOperation(requestId, authorizationData); // Use TrackAsync to indicate that the application should wait to ensure that // the download status is completed. var reportingOperationStatus = await reportingDownloadOperation.TrackAsync(); var resultFilePath = await reportingDownloadOperation.DownloadResultFileAsync( FileDirectory, ResultFileName, decompress: true, overwrite: true); // Set this value true if you want to overwrite the same file. OutputStatusMessage(String.Format("Download result file: {0}", resultFilePath)); OutputStatusMessage(String.Format("Status: {0}", reportingOperationStatus.Status)); OutputStatusMessage(String.Format("TrackingId: {0}\n", reportingOperationStatus.TrackingId)); }