Table of Contents

Interface IFeedManager

Namespace
ZeroInstall.Services.Feeds
Assembly
ZeroInstall.Services.dll

Provides access to remote and local Feeds. Handles downloading and signature verification.

public interface IFeedManager
Extension Methods

Properties

this[FeedUri]

Returns a specific Feed. Automatically handles downloading, calling Normalize(FeedUri?) and caching. Updates the Stale indicator.

Feed this[FeedUri feedUri] { get; }

Parameters

feedUri FeedUri

The URI of the feed.

Property Value

Feed

The normalized Feed. Do not modify! The same instance may be returned to future callers.

Remarks

Feeds are always served from the IFeedCache if possible, unless Refresh is set to true.

Exceptions

UriFormatException

Uri is missing or does not match feedUri.

OperationCanceledException

The user canceled the task.

WebException

A problem occurred while fetching the feed file.

IOException

A problem occurred while reading the feed file.

UnauthorizedAccessException

Access to the cache is not permitted.

SignatureException

The signature data of a remote feed file could not be verified.

InvalidDataException

A required property on the feed is not set or invalid.

Refresh

Set to true to re-download Feeds even if they are already in the IFeedCache.

bool Refresh { get; set; }

Property Value

bool

ShouldRefresh

Indicates whether Stale is true and EffectiveNetworkUse is Full.

bool ShouldRefresh { get; }

Property Value

bool

Stale

Is set to true if any Feed returned by this[FeedUri] is getting stale and should be updated by setting Refresh to true.

bool Stale { get; set; }

Property Value

bool

Remarks

Freshness controls the time span after which a feed is considered stale.

Methods

Clear()

Clears any in-memory caches.

void Clear()

GetPreferences(FeedUri)

Returns FeedPreferences for a specific feed.

FeedPreferences GetPreferences(FeedUri feedUri)

Parameters

feedUri FeedUri

The URI of the feed.

Returns

FeedPreferences

ImportFeed(Stream, OpenPgpKeyCallback?)

Imports a remote Feed into the IFeedCache after verifying its signature.

void ImportFeed(Stream stream, OpenPgpKeyCallback? keyCallback = null)

Parameters

stream Stream

The content of the feed file.

keyCallback OpenPgpKeyCallback

Callback for reading a specific OpenPGP public key file.

Exceptions

IOException

A problem occurred while reading the feed file.

UnauthorizedAccessException

Access to the feed file or the cache is not permitted.

InvalidDataException

A problem occurred while deserializing an XML file.

SignatureException

The signature data of the feed file could not be handled or no signatures were trusted.

IsStale(FeedUri)

Determines whether there is a stale cached copy of a particular feed.

bool IsStale(FeedUri feedUri)

Parameters

feedUri FeedUri

The URI of the feed.

Returns

bool

true if there is a stale copy in the cache or no copy at all; false if there is a fresh copy in the cache.

RateLimit(FeedUri)

Ensures that operations regarding a specific feed do not happen to often in a row.

bool RateLimit(FeedUri feedUri)

Parameters

feedUri FeedUri

The URI of the feed.

Returns

bool

true if the operation should be skipped due to rate limiting; false if the operation may proceed.