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
configConfigtrustManagerITrustManagerhandlerITaskHandler
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
uriFeedUriThe URI of the source to add.
Returns
- bool
 trueif the source was add;falseif 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
sourceFeedUriThe 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 IReadOnlyList<FeedUri> GetSources()
  Returns
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 IReadOnlyList<FeedUri> GetSources(bool preferMachineWide)
  Parameters
preferMachineWideboolAt most one configuration file is processed. If
truemachine-wide config is preferred; iffalseper-user config is preferred.
Returns
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
uriFeedUriThe URI of the source to remove.
Returns
- bool
 trueif the source was removed;falseif 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
urisIEnumerable<FeedUri>The list of catalog sources to use from now on.
machineWidebooltrueto save in a machine-wide location;falseto 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()