Class UriExtensions
Provides extension methods for Uris.
Inheritance
UriExtensions
Assembly: NanoByte.Common.dll
Syntax
public static class UriExtensions : Object
Methods
EnsureTrailingSlash(Uri)
Adds a trailing slash to the URI if it does not already have one.
Declaration
public static Uri EnsureTrailingSlash(this Uri uri)
Parameters
Type |
Name |
Description |
Uri |
uri |
|
Returns
GetLocalFileName(Uri)
Extracts the file-name portion of an URI and ensures it is a valid file-name on the local OS.
Declaration
public static string GetLocalFileName(this Uri uri)
Parameters
Type |
Name |
Description |
Uri |
uri |
|
Returns
GetRoot(Uri)
Removes everything except the schema, host and port from the URI. Returns the original URI if it is not an absolute URI.
Declaration
public static Uri GetRoot(this Uri uri)
Parameters
Type |
Name |
Description |
Uri |
uri |
|
Returns
ReparseAsAbsolute(Uri)
Reparses a URI (generated via conversion) to ensure it is a valid absolute URI.
Declaration
public static Uri ReparseAsAbsolute(this Uri uri)
Parameters
Type |
Name |
Description |
Uri |
uri |
|
Returns
ToStringRfc(Uri)
An alternate version of ToString() that produces results escaped according to RFC 2396.
Declaration
public static string ToStringRfc(this Uri uri)
Parameters
Type |
Name |
Description |
Uri |
uri |
|
Returns