Table of Contents

Class RetrievalMethodExtensions

Namespace
ZeroInstall.Publish
Assembly
ZeroInstall.Publish.dll

Helpers for setting missing properties on RetrievalMethods.

public static class RetrievalMethodExtensions
Inheritance
RetrievalMethodExtensions
Inherited Members

Methods

CalculateDigest(RetrievalMethod, ICommandExecutor, ITaskHandler, ManifestFormat?)

Calculates a ManifestDigest for a retrieval method. Sets missing properties in the process.

public static ManifestDigest CalculateDigest(this RetrievalMethod retrievalMethod, ICommandExecutor executor, ITaskHandler handler, ManifestFormat? format = null)

Parameters

retrievalMethod RetrievalMethod

The retrieval method.

executor ICommandExecutor

Used to modify properties in an undoable fashion.

handler ITaskHandler

A callback object used when the the user is to be informed about progress.

format ManifestFormat

The manifest format. Leave null for default.

Returns

ManifestDigest

The generated digest.

Exceptions

OperationCanceledException

The user canceled the task.

WebException

A file could not be downloaded from the internet.

SetMissing(DownloadRetrievalMethod, ICommandExecutor, string?)

Sets missing properties on the retrieval method if they can be inferred.

public static void SetMissing(this DownloadRetrievalMethod retrievalMethod, ICommandExecutor executor, string? localPath = null)

Parameters

retrievalMethod DownloadRetrievalMethod

The retrieval method.

executor ICommandExecutor

Used to modify properties in an undoable fashion.

localPath string

An optional local file path where the retrievalMethod has already been downloaded.

ToTempDir(DownloadRetrievalMethod, ITaskHandler, string?)

Creates a temporary directory from a retrieval method. Sets missing properties in the process.

public static TemporaryDirectory ToTempDir(this DownloadRetrievalMethod retrievalMethod, ITaskHandler handler, string? localPath = null)

Parameters

retrievalMethod DownloadRetrievalMethod

The retrieval method.

handler ITaskHandler

A callback object used when the the user is to be informed about progress.

localPath string

An optional local file path where the retrievalMethod has already been downloaded. Leave null to download automatically.

Returns

TemporaryDirectory

A temporary directory built using the retrieval method.

Exceptions

OperationCanceledException

The user canceled the task.

WebException

A file could not be downloaded from the internet.

IOException

There is a problem writing a temporary file.

UnauthorizedAccessException

Write access to a temporary file is not permitted.