Exists() public abstract method

public abstract Exists ( string fileName ) : bool
fileName string
return bool
        private Task <PackageMonitoringStatus> GetPackageAsync(CatalogStorage storage, string fileName, CancellationToken token)
        {
            if (!storage.Exists(fileName))
            {
                return(Task.FromResult <PackageMonitoringStatus>(null));
            }

            return(GetPackageAsync(storage, storage.ResolveUri(fileName), token));
        }
示例#2
0
        async Task UpdateMetadata(Storage storage, Action<HashSet<NuGetVersion>> updateAction, CancellationToken cancellationToken)
        {
            string relativeAddress = "index.json";
            var resourceUri = new Uri(storage.BaseAddress, relativeAddress);
            HashSet<NuGetVersion> versions = GetVersions(await storage.LoadString(resourceUri, cancellationToken));
            updateAction(versions);
            List<NuGetVersion> result = new List<NuGetVersion>(versions);

            if (result.Any())
            {
                // Store versions (sorted)
                result.Sort();
                await storage.Save(resourceUri, CreateContent(result.Select((v) => v.ToString())), cancellationToken);
            }
            else
            {
                // Remove versions file if no versions are present
                if (storage.Exists(relativeAddress))
                {
                    await storage.Delete(resourceUri, cancellationToken);
                }
            }
        }
示例#3
0
 public override bool Exists(string fileName)
 {
     return(_primaryStorage.Exists(fileName));
 }
示例#4
0
 private async Task DeleteNupkg(Storage storage, string id, string version, CancellationToken cancellationToken)
 {
     string relativeAddress = string.Format("{1}/{0}.{1}.nupkg", id, version);
     Uri nupkgUri = new Uri(storage.BaseAddress, relativeAddress);
     if (storage.Exists(relativeAddress))
     {
         await storage.Delete(nupkgUri, cancellationToken);
     }
 }