public Stream LoadPackage(PackageEntry packageEntry)
        {
            var response = _httpClientGetter(packageEntry.PackageHref.BaseUri(_baseUri))
                           .Get()
                           .Send();

            return(response.Entity != null ? response.Entity.Stream : null);
        }
Example #2
0
 public PackageEntryWrapper(IPackageRepository source, PackageEntry entry, Func<IPackage> load)
 {
     Source = source;
     _entry = entry;
     _load = load;
     Identifier = new PackageIdentifier(_entry.Name, _entry.Version);
     Dependencies = entry.Dependencies.Select(DependsParser.ParseDependsValue).ToList();
 }
        public Stream LoadPackage(PackageEntry packageEntry)
        {
            var response = _httpClientGetter(packageEntry.PackageHref.BaseUri(_baseUri))
                    .Get()
                    .Send();

            return response.Entity != null ? response.Entity.Stream : null;
        }
Example #4
0
 public PackageEntryWrapper(IPackageRepository source, PackageEntry entry, Func <IPackage> load)
 {
     Source       = source;
     _entry       = entry;
     _load        = load;
     Identifier   = new PackageIdentifier(_entry.Name, _entry.Version);
     Dependencies = entry.Dependencies.Select(DependsParser.ParseDependsValue).ToList();
 }
Example #5
0
 static bool EntryIsValid(PackageEntry entry)
 {
     var entryIsValid = entry.Name != null &&
                        entry.Version != null &&
                        PackageNameUtility.IsNameValid(entry.Name) &&
                        entry.Dependencies.All(_ => PackageNameUtility.IsNameValid(_.Split(' ')[0]));
     if (!entryIsValid)
         Debug.WriteLine("invalid package");
     return entryIsValid;
 }
Example #6
0
 public HttpPackage(IFileSystem fileSystem,
                    IPackageRepository source,
                    IHttpRepositoryNavigator httpNavigator,
                    PackageEntry package)
 {
     _fileSystem = fileSystem;
     _httpNavigator = httpNavigator;
     _package = package;
     _identifier = Lazy.Is(() => new PackageIdentifier(Name, SemanticVersion));
     Source = source;
 }
Example #7
0
 public HttpPackage(IFileSystem fileSystem,
                    IPackageRepository source,
                    IHttpRepositoryNavigator httpNavigator,
                    PackageEntry package)
 {
     _fileSystem    = fileSystem;
     _httpNavigator = httpNavigator;
     _package       = package;
     _identifier    = Lazy.Is(() => new PackageIdentifier(Name, Version));
     Source         = source;
 }
Example #8
0
        public HttpPackageInfo(IFileSystem fileSystem,
            IPackageRepository source,
            IHttpRepositoryNavigator httpNavigator,
            PackageEntry package)
        {
            Source = source;
            _fileSystem = fileSystem;
            _httpNavigator = httpNavigator;
            _package = package;

            _lastModifiedTimeUtc = package.CreationTime;
            _nuked = package.Nuked;

            Dependencies = (from dependency in _package.Dependencies
                            let strings = dependency.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries)
                            where strings.Length >= 1
                            let dependencyName = strings[0]
                            where !string.IsNullOrEmpty(dependencyName)
                            select (PackageDependency)new PackageDependencyBuilder(dependencyName)
                                                              .SetVersionVertices(DependsParser.ParseVersions(strings.Skip(1).ToArray()))
                           )
                    .ToList();
        }
Example #9
0
        public HttpPackageInfo(IFileSystem fileSystem,
                               IPackageRepository source,
                               IHttpRepositoryNavigator httpNavigator,
                               PackageEntry package)
        {
            Source         = source;
            _fileSystem    = fileSystem;
            _httpNavigator = httpNavigator;
            _package       = package;

            _lastModifiedTimeUtc = package.CreationTime;
            _nuked = package.Nuked;

            Dependencies = (from dependency in _package.Dependencies
                            let strings = dependency.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries)
                                          where strings.Length >= 1
                                          let dependencyName = strings[0]
                                                               where !string.IsNullOrEmpty(dependencyName)
                                                               select(PackageDependency) new PackageDependencyBuilder(dependencyName)
                                                               .SetVersionVertices(DependsParser.ParseVersions(strings.Skip(1).ToArray()))
                            )
                           .ToList();
        }
 public Stream LoadPackage(PackageEntry packageEntry)
 {
     var packageFile = _directory.GetFile(packageEntry.PackageHref.ToString());
     return packageFile.Exists ? packageFile.OpenRead() : null;
 }
Example #11
0
 public Stream LoadPackage(PackageEntry packageEntry)
 {
     throw new NotSupportedException();
 }