Interface IAsyncPackageCoreReader
A basic asynchronous package reader that provides the identity, min client version, and file access.
public interface IAsyncPackageCoreReader : IDisposable
- Inherited Members
- Extension Methods
Remarks
Higher level concepts used for normal development nupkgs should go at a higher level
Methods
CopyFilesAsync(string, IEnumerable<string>, ExtractPackageFileDelegate, ILogger, CancellationToken)
Asynchronously copies files from a package to a new location.
Task<IEnumerable<string>> CopyFilesAsync(string destination, IEnumerable<string> packageFiles, ExtractPackageFileDelegate extractFile, ILogger logger, CancellationToken cancellationToken)
Parameters
destinationstringThe destination path to copy to.
packageFilesIEnumerable<string>The package files to copy.
extractFileExtractPackageFileDelegateA package file extraction delegate.
loggerILoggerA logger.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<IEnumerable<string>>
A task that represents the asynchronous operation. The task result (Result) returns am IEnumerable<T> for the copied file paths.
Exceptions
- OperationCanceledException
Thrown if
cancellationTokenis cancelled.
GetFilesAsync(string, CancellationToken)
Asynchronously gets files in a folder in the package.
Task<IEnumerable<string>> GetFilesAsync(string folder, CancellationToken cancellationToken)
Parameters
folderstringA folder path in the package.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<IEnumerable<string>>
A task that represents the asynchronous operation. The task result (Result) returns an IEnumerable<T> for files under the specified folder.
Exceptions
- OperationCanceledException
Thrown if
cancellationTokenis cancelled.
GetFilesAsync(CancellationToken)
Asynchronously gets all files in the package.
Task<IEnumerable<string>> GetFilesAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<IEnumerable<string>>
A task that represents the asynchronous operation. The task result (Result) returns an IEnumerable<T>.
Exceptions
- OperationCanceledException
Thrown if
cancellationTokenis cancelled.
GetIdentityAsync(CancellationToken)
Asynchronously gets the identity of the package.
Task<PackageIdentity> GetIdentityAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<PackageIdentity>
A task that represents the asynchronous operation. The task result (Result) returns a PackageIdentity.
Exceptions
- OperationCanceledException
Thrown if
cancellationTokenis cancelled.
GetMinClientVersionAsync(CancellationToken)
Asynchronously gets the minimum client version needed to consume the package.
Task<NuGetVersion> GetMinClientVersionAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<NuGetVersion>
A task that represents the asynchronous operation. The task result (Result) returns a NuGet.Versioning.NuGetVersion.
Exceptions
- OperationCanceledException
Thrown if
cancellationTokenis cancelled.
GetNuspecAsync(CancellationToken)
Asynchronously gets a nuspec stream.
Task<Stream> GetNuspecAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<Stream>
A task that represents the asynchronous operation. The task result (Result) returns a Stream.
Exceptions
- OperationCanceledException
Thrown if
cancellationTokenis cancelled.
GetNuspecFileAsync(CancellationToken)
Asynchronously gets a nuspec file path.
Task<string> GetNuspecFileAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<string>
A task that represents the asynchronous operation. The task result (Result) returns a string representing the nuspec file path.
Exceptions
- OperationCanceledException
Thrown if
cancellationTokenis cancelled.
GetPackageTypesAsync(CancellationToken)
Asynchronously gets zero or more package types from the .nuspec.
Task<IReadOnlyList<PackageType>> GetPackageTypesAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<IReadOnlyList<PackageType>>
A task that represents the asynchronous operation. The task result (Result) returns an IReadOnlyList<T>.
Exceptions
- OperationCanceledException
Thrown if
cancellationTokenis cancelled.
GetStreamAsync(string, CancellationToken)
Asynchronously returns a file stream from the package.
Task<Stream> GetStreamAsync(string path, CancellationToken cancellationToken)
Parameters
pathstringThe file path in the package.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<Stream>
A task that represents the asynchronous operation. The task result (Result) returns a Stream.
Exceptions
- OperationCanceledException
Thrown if
cancellationTokenis cancelled.