public static PackageCatalogItem CreateCatalogItem( string origin, Stream stream, DateTime createdDate, DateTime?lastEditedDate = null, DateTime?publishedDate = null, string licenseNames = null, string licenseReportUrl = null, string packageHash = null, PackageDeprecationItem deprecationItem = null, IList <PackageVulnerabilityItem> vulnerabilities = null) { try { NupkgMetadata nupkgMetadata = GetNupkgMetadata(stream, packageHash); return(new PackageCatalogItem( nupkgMetadata, createdDate, lastEditedDate, publishedDate, deprecation: deprecationItem, vulnerabilities: vulnerabilities)); } catch (InvalidDataException e) { Trace.TraceError("Exception: {0} {1} {2}", origin, e.GetType().Name, e); return(null); } catch (Exception e) { throw new Exception(string.Format("Exception processsing {0}", origin), e); } }
public PackageCatalogItem( NupkgMetadata nupkgMetadata, DateTime?createdDate = null, DateTime?lastEditedDate = null, DateTime?publishedDate = null, string licenseNames = null, string licenseReportUrl = null, PackageDeprecationItem deprecation = null) { NupkgMetadata = nupkgMetadata; CreatedDate = createdDate; LastEditedDate = lastEditedDate; PublishedDate = publishedDate; Deprecation = deprecation; }