Class ImplementationExtensions
- Namespace
- ZeroInstall.Publish
- Assembly
- ZeroInstall.Publish.dll
Helpers for setting missing properties on Implementations.
public static class ImplementationExtensions
- Inheritance
-
objectImplementationExtensions
Methods
AddArchive(Implementation, Uri, string?, string?, IEnumerable<ManifestFormat>?, ICommandExecutor, ITaskHandler)
Adds an Archive to the implementation and sets its ManifestDigest and ID accordingly.
public static void AddArchive(this Implementation implementation, Uri href, string? localPath, string? extract, IEnumerable<ManifestFormat>? formats, ICommandExecutor executor, ITaskHandler handler)
Parameters
implementationImplementationThe implementation.
hrefUriThe URL the archive can be downloaded from.
localPathstringA local copy of the archive;
nullto look for a file named likehrefin the current directory.extractstringThe subdirectory of the archive to extract;
nullfor entire archive.formatsIEnumerable<ManifestFormat>The manifest formats to calculate digests for. Leave empty for default.
executorICommandExecutorUsed to modify properties in an undoable fashion.
handlerITaskHandlerA callback object used when the user is to be informed about progress.
Exceptions
- OperationCanceledException
The user canceled the task.
- FileNotFoundException
No local copy of the archive could be found.
- IOException
A problem occurred while extracting the archive.
- NotSupportedException
The archive type could not be determined.
- DigestMismatchException
An existing digest does not match the newly calculated one.
AddDigest(Implementation, ManifestFormat, IImplementationStore, ICommandExecutor, ITaskHandler)
Adds a digest in an additional ManifestFormat to the implementation, using a cached copy of the implementation.
public static bool AddDigest(this Implementation implementation, ManifestFormat format, IImplementationStore implementationStore, ICommandExecutor executor, ITaskHandler handler)
Parameters
implementationImplementationThe implementation.
formatManifestFormatThe manifest format to add a digest for.
implementationStoreIImplementationStoreUsed to look for a cached copy of the implementation.
executorICommandExecutorUsed to modify properties in an undoable fashion.
handlerITaskHandlerA callback object used when the user is to be informed about progress.
Returns
- bool
trueif a digest was added;falseif the digest was already present or no cached copy was found.
Exceptions
- OperationCanceledException
The user canceled the task.
- IOException
A problem occurred while reading the cached implementation.
- DigestMismatchException
The cached implementation does not match its expected digest.
SetMissing(Implementation, ICommandExecutor, ITaskHandler)
Sets missing properties on the implementation by downloading and inferring.
public static void SetMissing(this Implementation implementation, ICommandExecutor executor, ITaskHandler handler)
Parameters
implementationImplementationThe implementation.
executorICommandExecutorUsed to modify properties in an undoable fashion.
handlerITaskHandlerA callback object used when the user is to be informed about progress.
Exceptions
- OperationCanceledException
The user canceled the task.
- WebException
A file could not be downloaded from the internet.
- DigestMismatchException
An existing digest does not match the newly calculated one.