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

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

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

            return(unzipFilePath);
        }
コード例 #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);
        }