コード例 #1
0
ファイル: Fetch.cs プロジェクト: zhyfeather/WOA-Deployer
        protected override async Task ExecuteCore()
        {
            if (fileSystemOperations.DirectoryExists(destination))
            {
                return;
            }

            var stream = await downloader.GetStream(url, progressObserver);

            await extractor.ExtractToFolder(stream, destination);
        }
コード例 #2
0
        public async Task Execute()
        {
            if (Directory.Exists(folderPath))
            {
                Log.Warning("{Pack} was already downloaded. Skipping download.", repository);
                return;
            }

            var openZipStream = await downloader.OpenZipStream(downloadUrl);

            using (var stream = openZipStream)
            {
                await extractor.ExtractToFolder(stream, folderPath);
            }
        }
コード例 #3
0
        public async Task Execute()
        {
            if (Directory.Exists(folderPath))
            {
                Log.Warning("{Pack} was already downloaded. Skipping download.", artifactName);
                return;
            }

            var artifact = await buildClient.LatestBuildArtifact(org, project, definitionId, artifactName);

            using (var httpClient = new HttpClient())
            {
                var stream = await httpClient.GetStreamAsync(artifact.Resource.DownloadUrl);

                await extractor.ExtractToFolder(stream, folderPath);
            }
        }