Table of Contents

Interface IPackageCoreReader

Namespace
NuGet.Packaging.Core
Assembly
Chocolatey.NuGet.Packaging.dll

Basic package reader that provides the identity, min client version, and file access.

public interface IPackageCoreReader : IDisposable
Inherited Members

Remarks

Higher level concepts used for normal development nupkgs should go at a higher level

Methods

CopyFiles(string, IEnumerable<string>, ExtractPackageFileDelegate, ILogger, CancellationToken)

Copies files from a package to a new location.

IEnumerable<string> CopyFiles(string destination, IEnumerable<string> packageFiles, ExtractPackageFileDelegate extractFile, ILogger logger, CancellationToken token)

Parameters

destination string

The destination folder path.

packageFiles IEnumerable<string>

The package files to copy.

extractFile ExtractPackageFileDelegate

A package file extraction delegate.

logger ILogger

A logger.

token CancellationToken

A cancellation token.

Returns

IEnumerable<string>

An enumerable of paths of files copied to the destination.

GetFiles()

Gets all files in the package.

IEnumerable<string> GetFiles()

Returns

IEnumerable<string>

An enumerable of files in the package.

GetFiles(string)

Gets files in a folder in the package.

IEnumerable<string> GetFiles(string folder)

Parameters

folder string

Folder path

Returns

IEnumerable<string>

An enumerable of files under specified folder.

GetIdentity()

Gets the package identity.

PackageIdentity GetIdentity()

Returns

PackageIdentity

A package identity.

GetMinClientVersion()

Gets the minimum client version needed to consume the package.

NuGetVersion GetMinClientVersion()

Returns

NuGetVersion

A NuGet version.

GetNuspec()

Gets a nuspec stream.

Stream GetNuspec()

Returns

Stream

A stream for the nuspec.

GetNuspecFile()

Gets a nuspec file path.

string GetNuspecFile()

Returns

string

The nuspec file path.

GetPackageTypes()

Gets zero or more package types from the .nuspec.

IReadOnlyList<PackageType> GetPackageTypes()

Returns

IReadOnlyList<PackageType>

A readonly list of package types.

GetStream(string)

Gets a file stream from the package.

Stream GetStream(string path)

Parameters

path string

Returns

Stream

A stream for a file in the package.