Class UriExtensions
Extension methods for URLs
Inherited Members
Namespace:FubarDev.WebDavServer
Assembly:FubarDev.WebDavServer.dll
Syntax
public static class UriExtensions
Methods
| Improve this Doc View SourceAppend(Uri, ICollection)
Appends the name of a collection to the baseUri
Declaration
public static Uri Append(this Uri baseUri, ICollection entry)
Parameters
Type | Name | Description |
---|---|---|
Uri | baseUri | The base URL to append the entry name to |
ICollection | entry | The ICollection whose name to append to the baseUri |
Returns
Type | Description |
---|---|
Uri | The baseUri with the entry name appended. |
Append(Uri, IDocument)
Appends the name of a document to the baseUri
Declaration
public static Uri Append(this Uri baseUri, IDocument entry)
Parameters
Type | Name | Description |
---|---|---|
Uri | baseUri | The base URL to append the entry name to |
IDocument | entry | The IDocument whose name to append to the baseUri |
Returns
Type | Description |
---|---|
Uri | The baseUri with the entry name appended. |
Append(Uri, IEntry)
Append the name of an entry to the baseUri
Declaration
public static Uri Append(this Uri baseUri, IEntry entry)
Parameters
Type | Name | Description |
---|---|---|
Uri | baseUri | The base URL to append the entry name to |
IEntry | entry | The IEntry whose name to append to the baseUri |
Returns
Type | Description |
---|---|
Uri | The baseUri with the entry name appended. |
Append(Uri, String, Boolean)
Append a relative URL to the baseUri
Declaration
public static Uri Append(this Uri baseUri, string relative, bool isEscaped)
Parameters
Type | Name | Description |
---|---|---|
Uri | baseUri | The base URL to append the relative URI to |
String | relative | The relative URL to append to the baseUri |
Boolean | isEscaped | Is the relative URL already escaped? |
Returns
Type | Description |
---|---|
Uri | The baseUri with the appended relative URL. |
Remarks
When the relative URL isn't escaped, then it MUST NOT contain a path separator.
Append(Uri, Uri)
Append a relative URI to the baseUri
Declaration
public static Uri Append(this Uri baseUri, Uri relativeUri)
Parameters
Type | Name | Description |
---|---|---|
Uri | baseUri | The base URL to append the relativeUri to |
Uri | relativeUri | The relative URL to append to the baseUri |
Returns
Type | Description |
---|---|
Uri | The baseUri with the appended relativeUri. |
AppendDirectory(Uri, String)
Appends a collection name to the baseUri
Declaration
public static Uri AppendDirectory(this Uri baseUri, string collectionName)
Parameters
Type | Name | Description |
---|---|---|
Uri | baseUri | The base URL to append the name to |
String | collectionName | The collection name to append |
Returns
Type | Description |
---|---|
Uri | The baseUri with the appended name. |
GetCollectionUri(Uri)
Gets the collection URL.
Declaration
public static Uri GetCollectionUri(this Uri url)
Parameters
Type | Name | Description |
---|---|---|
Uri | url | The URL to get the collection for |
Returns
Type | Description |
---|---|
Uri | The collection URL |
Remarks
This is different from GetParent(Uri), because this function returns the same URL if the url is already an URL to a collection.
GetName(Uri)
Gets the name of the collection or document URL
Declaration
public static string GetName(this Uri url)
Parameters
Type | Name | Description |
---|---|---|
Uri | url | The collection or document URL |
Returns
Type | Description |
---|---|
String | The name of the collection or document URL |
GetParent(Uri)
Gets the URL of the containing collection of a collection or document URL
Declaration
public static Uri GetParent(this Uri url)
Parameters
Type | Name | Description |
---|---|---|
Uri | url | The URL to get the parent URL for |
Returns
Type | Description |
---|---|
Uri | The URL of the containing collection |
UriEscape(String)
Escapes the string in a WebDAV compatible way
Declaration
public static string UriEscape(this string s)
Parameters
Type | Name | Description |
---|---|---|
String | s | The string to escape |
Returns
Type | Description |
---|---|
String | The escaped string |