Class FeedExtensions
- Namespace
- ZeroInstall.Publish
- Assembly
- ZeroInstall.Publish.dll
Helpers for editing Feeds.
public static class FeedExtensions
- Inheritance
-
objectFeedExtensions
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
feedFeedThe feed.
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.
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
feedFeedThe feed.
formatManifestFormatThe manifest format to add digests for.
implementationStoreIImplementationStoreUsed to look for cached copies of the implementations.
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.
- 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
feedFeedThe feed.
versionImplementationVersionThe version number of the new implementation.
executorICommandExecutorUsed 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
feedFeedThe feed.
executorICommandExecutorUsed 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
feedFeedThe feed.
versionImplementationVersionThe version number to look for;
nullto 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.