Table of Contents

Class CatalogManager

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

Provides access to remote and local Catalogs. Handles downloading, signature verification and caching.

public class CatalogManager : ICatalogManager
Inheritance
CatalogManager
Implements
Inherited Members
Extension Methods

Constructors

CatalogManager(Config, ITrustManager, ITaskHandler)

Provides access to remote and local Catalogs. Handles downloading, signature verification and caching.

public CatalogManager(Config config, ITrustManager trustManager, ITaskHandler handler)

Parameters

config Config
trustManager ITrustManager
handler ITaskHandler

Fields

DefaultSource

The default Catalog source used if no other is specified.

public static readonly FeedUri DefaultSource

Field Value

FeedUri

Methods

AddSource(FeedUri)

Adds a new source to download Catalog files from.

public bool AddSource(FeedUri uri)

Parameters

uri FeedUri

The URI of the source to add.

Returns

bool

true if the source was add; false if the source was already in the list.

Exceptions

IOException

There was a problem accessing a configuration file.

UnauthorizedAccessException

Access to a configuration file was not permitted.

UriFormatException

An invalid catalog source is specified in the configuration file.

DownloadCatalog(FeedUri)

Downloads and normalizes a remote catalog file. Mainly for internal use.

public Catalog DownloadCatalog(FeedUri source)

Parameters

source FeedUri

The URL to download the catalog file from.

Returns

Catalog

The parsed Catalog.

Exceptions

WebException

A file could not be downloaded from the internet.

SignatureException

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

NotSupportedException

The catalog requires a newer version of Zero Install.

InvalidDataException

A problem occurred while deserializing an XML file.

GetCached()

Loads the last result of GetOnline().

public Catalog? GetCached()

Returns

Catalog

A Catalog; null if there is no cached data.

Exceptions

IOException

A problem occurred while reading the cache file.

UnauthorizedAccessException

Access to the cache file was not permitted.

InvalidDataException

A problem occurred while deserializing an XML file.

GetOnline()

Downloads and merges all Catalogs specified by the configuration files.

public Catalog GetOnline()

Returns

Catalog

A Catalog.

Exceptions

IOException

A problem occurred while reading a local catalog file.

UnauthorizedAccessException

Access to a local catalog file was not permitted.

WebException

A problem occurred while fetching a remote catalog file.

NotSupportedException

The catalog requires a newer version of Zero Install.

InvalidDataException

A problem occurred while deserializing an XML file.

SignatureException

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

UriFormatException

An invalid catalog source is specified in the configuration file.

GetSources()

Returns a list of catalog sources as defined by configuration files.

public FeedUri[] GetSources()

Returns

FeedUri[]

Exceptions

IOException

There was a problem accessing a configuration file.

UnauthorizedAccessException

Access to a configuration file was not permitted.

UriFormatException

An invalid catalog source is specified in the configuration file.

GetSources(bool)

Returns a list of catalog sources as defined by configuration files.

public static FeedUri[] GetSources(bool preferMachineWide)

Parameters

preferMachineWide bool

At most one configuration file is processed. If true machine-wide config is preferred; if false per-user config is preferred.

Returns

FeedUri[]

Remarks

Only the top-most configuration file is processed. I.e., a user config overrides a system config.

Exceptions

IOException

There was a problem accessing a configuration file.

UnauthorizedAccessException

Access to a configuration file was not permitted.

UriFormatException

An invalid catalog source is specified in the configuration file.

RemoveSource(FeedUri)

Removes an existing source of Catalog files.

public bool RemoveSource(FeedUri uri)

Parameters

uri FeedUri

The URI of the source to remove.

Returns

bool

true if the source was removed; false if the source was not in the current list.

Exceptions

IOException

There was a problem accessing a configuration file.

UnauthorizedAccessException

Access to a configuration file was not permitted.

UriFormatException

An invalid catalog source is specified in the configuration file.

SetSources(IEnumerable<FeedUri>, bool)

Sets the list of catalog sources in a configuration file.

public static void SetSources(IEnumerable<FeedUri> uris, bool machineWide = false)

Parameters

uris IEnumerable<FeedUri>

The list of catalog sources to use from now on.

machineWide bool

true to save in a machine-wide location; false to save in the user profile.

Exceptions

IOException

There was a problem writing a configuration file.

UnauthorizedAccessException

Access to a configuration file was not permitted.