Exemplo n.º 1
0
        public Task DeleteReadmeFileAsync(string id, string version)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id));
            }

            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentException($"{nameof(id)} cannot be empty", nameof(id));
            }

            if (version == null)
            {
                throw new ArgumentNullException(nameof(version));
            }

            if (string.IsNullOrWhiteSpace(version))
            {
                throw new ArgumentException($"{nameof(version)} cannot be empty", nameof(version));
            }

            var normalizedVersion = NuGetVersionFormatter.Normalize(version);
            var fileName          = BuildReadmeFileName(id, normalizedVersion);

            return(_fileStorageService.DeleteFileAsync(_metadata.PackageContentFolderName, fileName));
        }
        public Task DeleteValidationPackageFileAsync(string id, string version)
        {
            if (version == null)
            {
                throw new ArgumentNullException(nameof(version));
            }

            var normalizedVersion = NuGetVersionFormatter.Normalize(version);
            var fileName          = BuildFileName(
                id,
                normalizedVersion,
                _metadata.FileSavePathTemplate,
                _metadata.FileExtension);

            return(_fileStorageService.DeleteFileAsync(_metadata.ValidationFolderName, fileName));
        }
Exemplo n.º 3
0
        public Task DeletePackageForValidationSetAsync(PackageValidationSet validationSet)
        {
            var fileName = BuildValidationSetPackageFileName(validationSet);

            _logger.LogInformation(
                "Deleting package for validation set {ValidationTrackingId} from {FolderName}/{FileName}.",
                validationSet.ValidationTrackingId,
                CoreConstants.ValidationFolderName,
                fileName);

            return(_fileStorageService.DeleteFileAsync(CoreConstants.ValidationFolderName, fileName));
        }
Exemplo n.º 4
0
        public Task DeleteValidationPackageFileAsync(PackageValidationSet validationSet)
        {
            var fileName = BuildFileName(validationSet, _fileMetadataService.FileSavePathTemplate, _fileMetadataService.FileExtension);

            return(_fileStorageService.DeleteFileAsync(_fileMetadataService.ValidationFolderName, fileName));
        }