protected override void GetMetadata(string path, string repository, out PackageProject project, out IList<MetadataEntry> metadata, out ILookup<ContentType, string> contents)
        {
            var packagePath = GetFilePath(path);

            Version version;

            using (var stream = File.OpenRead(packagePath))
                version = versionExtractor.Extract(stream);
            
            var package = new ZipPackage(packagePath);

            metadata = version.Metadata;

            project = new PackageProject
                          {
                              Name = version.Project,
                              Repository = repository,
                              Version =
                                  new PackageVersion
                                      {
                                          Project = version.Project,
                                          Name = version.Name,
                                          Metadata = version.Metadata,
                                          Compilations =
                                              package.AssemblyReferences
                                              .GroupBy(reference => reference.TargetFramework)
                                              .Select(group => new PackageCompilation
                                                                   {
                                                                       Mode = "Release",
                                                                       Platform = group.Key != null ? group.Key.ToString() : "Default",
                                                                       ImageFiles =
                                                                           group.Select(reference => new PackageImageFile
                                                                                                         {
                                                                                                             Name = reference.Path.Replace(@"\", @"/")
                                                                                                         }
                                                                           ).ToArray(),
                                                                   })

                                              .ToArray(),
                                      }

                          };


            using (var zip = new ZipFile(packagePath))
                contents = zip.EntryFileNames.ToLookup(GetContentType);
        }
        protected override void GetMetadata(string path, string repository, out PackageProject project, out IList <MetadataEntry> metadata, out ILookup <ContentType, string> contents)
        {
            var packagePath = GetFilePath(path);

            Version version;

            using (var stream = File.OpenRead(packagePath))
                version = versionExtractor.Extract(stream);

            var package = new ZipPackage(packagePath);

            metadata = version.Metadata;

            project = new PackageProject
            {
                Name       = version.Project,
                Repository = repository,
                Version    =
                    new PackageVersion
                {
                    Project      = version.Project,
                    Name         = version.Name,
                    Metadata     = version.Metadata,
                    Compilations =
                        package.AssemblyReferences
                        .GroupBy(reference => reference.TargetFramework)
                        .Select(group => new PackageCompilation
                    {
                        Mode       = "Release",
                        Platform   = group.Key != null ? group.Key.ToString() : "Default",
                        ImageFiles =
                            group.Select(reference => new PackageImageFile
                        {
                            Name = reference.Path.Replace(@"\", @"/")
                        }
                                         ).ToArray(),
                    })

                        .ToArray(),
                }
            };


            using (var zip = new ZipFile(packagePath))
                contents = zip.EntryFileNames.ToLookup(GetContentType);
        }
        protected override bool?GetProjectPermission(Caller caller, string companyName, PackageProject project)
        {
            var configuration = configurationFactory.Create(companyName, project.Repository);

            if (string.IsNullOrEmpty(configuration.NuGetService))
            {
                return(null);
            }

            return(new NuGetService(configuration.NuGetService).CheckPermission(caller.KeyValue, project.Name));
        }
        protected override bool? GetProjectPermission(Caller caller, string companyName, PackageProject project)
        {
            var configuration = configurationFactory.Create(companyName, project.Repository);

            if (string.IsNullOrEmpty(configuration.NuGetService))
                return null;

            return new NuGetService(configuration.NuGetService).CheckPermission(caller.KeyValue, project.Name);
        }