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
ConfigtrustManager
ITrustManagerhandler
ITaskHandler
Fields
DefaultSource
The default Catalog source used if no other is specified.
public static readonly FeedUri DefaultSource
Field Value
Methods
AddSource(FeedUri)
Adds a new source to download Catalog files from.
public bool AddSource(FeedUri uri)
Parameters
uri
FeedUriThe 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.
public Catalog DownloadCatalog(FeedUri source)
Parameters
source
FeedUriThe URL to download the catalog file from.
Returns
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.
GetOnline()
Downloads and merges all Catalogs specified by the configuration files.
public Catalog GetOnline()
Returns
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
boolAt most one configuration file is processed. If
true
machine-wide config is preferred; iffalse
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
FeedUriThe 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
booltrue
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.
TryGetCached()
Tries to return a locally cached copy of the merged Catalogs specified by the configuration files, as previously returned by GetOnline().
public Catalog? TryGetCached()