Ejemplo n.º 1
0
        public Task <Uri> GetPackageUriAsync(PackageValidationSet validationSet)
        {
            var fileName = BuildFileName(validationSet,
                                         _fileMetadataService.FileSavePathTemplate,
                                         _fileMetadataService.FileExtension);

            return(_fileStorageService.GetFileUriAsync(_fileMetadataService.FileFolderName, fileName));
        }
        public async Task <Uri> GetReadAndDeleteUriAsync(
            string packageId,
            string packageNormalizedVersion,
            Guid validationId,
            string sasDefinition)
        {
            var fileName = BuildFileName(packageId, packageNormalizedVersion, validationId);

            if (string.IsNullOrEmpty(sasDefinition))
            {
                return(await _fileStorageService.GetPriviledgedFileUriAsync(
                           CoreConstants.Folders.ValidationFolderName,
                           fileName,
                           FileUriPermissions.Read | FileUriPermissions.Delete,
                           DateTimeOffset.UtcNow + AccessDuration));
            }

            var fileUri = await _fileStorageService.GetFileUriAsync(CoreConstants.Folders.ValidationFolderName, fileName);

            var sasToken = await _sharedAccessSignatureService.GetFromManagedStorageAccountAsync(sasDefinition);

            return(new Uri(fileUri, sasToken));
        }
        public Task <Uri> GetPackageUriAsync(Package package)
        {
            var fileName = FileNameHelper.BuildFileName(package, _metadata.FileSavePathTemplate, _metadata.FileExtension);

            return(_fileStorageService.GetFileUriAsync(_metadata.FileFolderName, fileName));
        }