Esempio n. 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);
        }
Esempio n. 2
0
        public async Task <string> DownloadAndExtractAsync(string xmlUrlPath, string saveFilePath = null)
        {
            var req = RequestEngine.CreateClient(_AccessConfig);

            var saveDirectoryPath = _AccessConfig.DownloadDirectory;

            if (!string.IsNullOrEmpty(saveFilePath))
            {
                saveDirectoryPath = Path.GetDirectoryName(saveFilePath);
            }

            var gzipFilePath = await RequestEngine.DownloadFileToDirectoryAsync(req, xmlUrlPath, saveDirectoryPath);

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

            return(unzipFilePath);
        }