Table of Contents

Class FeedExtensions

Namespace
ZeroInstall.Publish
Assembly
ZeroInstall.Publish.dll

Helpers for editing Feeds.

public static class FeedExtensions
Inheritance
object
FeedExtensions

Remarks

These operate on the un-normalized feed structure, i.e. Group inheritance is resolved on the fly rather than by calling Normalize(FeedUri?). This keeps the feed serializable.

Methods

AddArchive(Feed, Uri, string?, string?, IEnumerable<ManifestFormat>?, ICommandExecutor, ITaskHandler)

Adds an Archive to the matching Implementation in the feed.

public static void AddArchive(this Feed feed, Uri href, string? localPath, string? extract, IEnumerable<ManifestFormat>? formats, ICommandExecutor executor, ITaskHandler handler)

Parameters

feed Feed

The feed.

href Uri

The URL the archive can be downloaded from.

localPath string

A local copy of the archive; null to look for a file named like href in the current directory.

extract string

The subdirectory of the archive to extract; null for entire archive.

formats IEnumerable<ManifestFormat>

The manifest formats to calculate digests for. Leave empty for default.

executor ICommandExecutor

Used to modify properties in an undoable fashion.

handler ITaskHandler

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

Remarks

The archive is added to the implementation that already carries the calculated digest as its ID, or else to the feed's only implementation with a local ID.

Exceptions

OperationCanceledException

The user canceled the task.

FileNotFoundException

No local copy of the archive could be found.

InvalidDataException

No suitable implementation to add the archive to was found.

NotSupportedException

The archive type could not be determined.

AddDigests(Feed, ManifestFormat, IImplementationStore, ICommandExecutor, ITaskHandler)

Adds digests in an additional ManifestFormat to all Implementations in the feed that have a cached copy.

public static void AddDigests(this Feed feed, ManifestFormat format, IImplementationStore implementationStore, ICommandExecutor executor, ITaskHandler handler)

Parameters

feed Feed

The feed.

format ManifestFormat

The manifest format to add digests for.

implementationStore IImplementationStore

Used to look for cached copies of the implementations.

executor ICommandExecutor

Used to modify properties in an undoable fashion.

handler ITaskHandler

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

Exceptions

OperationCanceledException

The user canceled the task.

DigestMismatchException

A cached implementation does not match its expected digest.

AddVersion(Feed, ImplementationVersion, ICommandExecutor)

Adds a new Implementation with a local ID to the feed.

public static Implementation AddVersion(this Feed feed, ImplementationVersion version, ICommandExecutor executor)

Parameters

feed Feed

The feed.

version ImplementationVersion

The version number of the new implementation.

executor ICommandExecutor

Used to modify properties in an undoable fashion.

Returns

Implementation

The newly added implementation.

Remarks

The implementation is placed next to the last existing one, inside the same Group (if any).

MarkStable(Feed, ICommandExecutor)

Marks the latest Testing Implementation(s) in the feed as Stable.

public static void MarkStable(this Feed feed, ICommandExecutor executor)

Parameters

feed Feed

The feed.

executor ICommandExecutor

Used to modify properties in an undoable fashion.

Exceptions

InvalidDataException

No implementation is currently testing.

SelectImplementations(Feed, ImplementationVersion?)

Determines which Implementations in the feed a --set-* style operation should be applied to.

public static IReadOnlyList<Implementation> SelectImplementations(this Feed feed, ImplementationVersion? version = null)

Parameters

feed Feed

The feed.

version ImplementationVersion

The version number to look for; null to look for the implementation that has not been released yet.

Returns

IReadOnlyList<Implementation>

One or more implementations. Never empty.

Exceptions

InvalidDataException

No matching implementation was found or the selection was ambiguous.