Example #1
0
        public async Task <string> DownloadAndExtractAsync()
        {
            var req = RequestEngine.CreateClient(_AccessConfig);

            var gzipFilePath = await RequestEngine.DownloadFileAsync(req, XmlFileUrl, _AccessConfig.DownloadDirectory);

            var unzipFilePath = await GZipUtils.DecompressAsync(new FileInfo(gzipFilePath));

            return(unzipFilePath);
        }
Example #2
0
        public async Task <string> DownloadAsync(string xmlUrlPath, string saveFilePath = null)
        {
            var req = RequestEngine.CreateClient(_AccessConfig);

            if (string.IsNullOrEmpty(saveFilePath))
            {
                saveFilePath = _AccessConfig.DownloadDirectory + xmlUrlPath.Split('/').Last();
            }

            return(await RequestEngine.DownloadFileAsync(req, xmlUrlPath, saveFilePath));
        }