Show / Hide Table of Contents

Class FeedUri

Represents a feed or interface URI or local path. Unlike Uri this class only accepts HTTP(S) URLs and absolute local paths.

Inheritance
Object
FeedUri
Implements
ISerializable
IEquatable<FeedUri>
Namespace: ZeroInstall.Model
Assembly: ZeroInstall.Model.dll
Syntax
public sealed class FeedUri : Uri

Constructors

FeedUri(String)

Creates a feed URI from a string.

Declaration
public FeedUri(string value)
Parameters
Type Name Description
String value

A string to parse as an HTTP(S) URL or an absolute local path.

Exceptions
Type Condition
UriFormatException

value is not a valid HTTP(S) URL or an absolute local path.

FeedUri(Uri)

Creates a feed URI from an existing Uri.

Declaration
public FeedUri(Uri value)
Parameters
Type Name Description
Uri value

An existing Uri.

Exceptions
Type Condition
UriFormatException

value is not a valid HTTP(S) URL or an absolute local path.

FeedUri(FeedUri)

Passing a FeedUri instance into the FeedUri constructor does nothing useful. Just use the original object.

Declaration
public FeedUri(FeedUri value)
Parameters
Type Name Description
FeedUri value

Fields

FakePrefix

This is prepended to a FeedUri if it is meant for demo data and should not be used to actually fetch a feed.

Declaration
public const string FakePrefix = "fake:"
Field Value
Type Description
String
See Also
IsFake

FromDistributionPrefix

This is prepended to FromFeed if data was pulled from a native package manager rather than the feed itself.

Declaration
public const string FromDistributionPrefix = "distribution:"
Field Value
Type Description
String
See Also
PackageImplementation
IsFromDistribution

Properties

IsFake

Indicates whether this is a fake identifier meant for demo data and should not be used to actually fetch a feed.

Declaration
public bool IsFake { get; }
Property Value
Type Description
Boolean
See Also
FakePrefix

IsFromDistribution

Indicates that an ImplementationSelection was generated with data from a native package manager rather than the feed itself.

Declaration
public bool IsFromDistribution { get; }
Property Value
Type Description
Boolean
See Also
FromDistributionPrefix

Methods

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
Object obj
Returns
Type Description
Boolean

Equals(FeedUri)

Declaration
public bool Equals(FeedUri other)
Parameters
Type Name Description
FeedUri other
Returns
Type Description
Boolean

Escape()

Escapes the identifier using URL encoding.

Declaration
public string Escape()
Returns
Type Description
String

Escape(String)

Escapes an identifier using URL encoding.

Declaration
public static string Escape(string value)
Parameters
Type Name Description
String value
Returns
Type Description
String

EscapeComponent()

Convert the identifier to a list of path components. e.g. "http://example.com/foo.xml"; becomes ["http", "example.com", "foo.xml"], while "/root/feed.xml" becomes ["file", "root__feed.xml"]. The number of components is determined by the scheme (three for http, two for file). Uses [underscore_escape] to escape each component.

Declaration
public string[] EscapeComponent()
Returns
Type Description
String[]

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
Int32

PrettyEscape()

Escapes the identifier using URL encoding except for slashes (encoded as #) and colons (left as-is on POSIX systems).

Declaration
public string PrettyEscape()
Returns
Type Description
String

PrettyEscape(String)

Escapes an identifier using URL encoding except for slashes (encoded as #) and colons (left as-is on POSIX systems).

Declaration
public static string PrettyEscape(string value)
Parameters
Type Name Description
String value
Returns
Type Description
String

PrettyUnescape(String)

Unescapes an identifier using URL encoding except for slashes (encoded as #).

Declaration
public static FeedUri PrettyUnescape(string escaped)
Parameters
Type Name Description
String escaped
Returns
Type Description
FeedUri

ToString()

Returns a string representation of the URI, not adhering to the escaping rules of RFC 2396. Not safe for parsing!

Declaration
public override string ToString()
Returns
Type Description
String

ToStringRfc()

An alternate version of ToString() that produces results escaped according to RFC 2396. Safe for parsing!

Declaration
public string ToStringRfc()
Returns
Type Description
String

Unescape(String)

Unescapes an identifier using URL encoding.

Declaration
public static FeedUri Unescape(string escaped)
Parameters
Type Name Description
String escaped
Returns
Type Description
FeedUri
Exceptions
Type Condition
UriFormatException

The unescaped string is not a valid HTTP(S) URL or an absolute local path.

Operators

Equality(FeedUri, FeedUri)

Indicates whether the object on the left is equal to the object on the right.

Declaration
public static bool operator ==(FeedUri left, FeedUri right)
Parameters
Type Name Description
FeedUri left

The left object

FeedUri right

The right object

Returns
Type Description
Boolean

true if the objects are equal; otherwise, false.

Inequality(FeedUri, FeedUri)

Indicates whether the object on the left is not equal to the object on the right.

Declaration
public static bool operator !=(FeedUri left, FeedUri right)
Parameters
Type Name Description
FeedUri left

The left object

FeedUri right

The right object

Returns
Type Description
Boolean

true if the objects are not equal; otherwise, false.

Implements

System.Runtime.Serialization.ISerializable
System.IEquatable<T>
In This Article
Back to top Copyright Bastian Eicher et al