示例#1
0
        protected async Task <LibraryLicense> ResolveUrlLicenseAsync(LibraryId id, string url, string subject, CancellationToken token)
        {
            var license = new LibraryLicense
            {
                Subject = subject,
                HRef    = url
            };

            var info = await LicenseResolver.ResolveByUrlAsync(url, token);

            license.Code = info?.Code;

            if (info?.FileContent != null)
            {
                await Storage.WriteLibraryFileAsync(id, subject + "-" + info.FileName, info.FileContent, token);
            }

            return(license);
        }
示例#2
0
 public GeneralInfoTableSource(LocalPackageCache packageCache, HttpDataProvider dataProvider, LicenseResolver licenseResolver)
 {
     this.packageCache    = packageCache;
     this.dataProvider    = dataProvider;
     this.licenseResolver = licenseResolver;
 }