Class FeedUri
Represents a feed or interface URI or local path. Unlike Uri this class only accepts HTTP(S) URLs and absolute local paths.
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
See Also
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
See Also
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
See Also
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
See Also
Methods
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
Object |
obj |
|
Returns
Equals(FeedUri)
Declaration
public bool Equals(FeedUri other)
Parameters
Type |
Name |
Description |
FeedUri |
other |
|
Returns
Escape()
Escapes the identifier using URL encoding.
Declaration
Returns
Escape(String)
Escapes an identifier using URL encoding.
Declaration
public static string Escape(string value)
Parameters
Type |
Name |
Description |
String |
value |
|
Returns
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
GetHashCode()
Declaration
public override int GetHashCode()
Returns
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
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
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
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
ToStringRfc()
An alternate version of ToString() that produces results escaped according to RFC 2396.
Safe for parsing!
Declaration
public string ToStringRfc()
Returns
Unescape(String)
Unescapes an identifier using URL encoding.
Declaration
public static FeedUri Unescape(string escaped)
Parameters
Type |
Name |
Description |
String |
escaped |
|
Returns
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