Show / Hide Table of Contents

Class UrlHelper

Class to assist working with URLs.

Inheritance
Object
UrlHelper
Namespace: SuperOffice.Util
Assembly: SoCore.dll
Syntax
public static class UrlHelper : Object

Methods

Combine(String, String, Boolean)

Safely appends one URL-segment on to another. This involves validating the individual URL parts and possibly throwing on invalid data or combinations of parts.

Declaration
public static string Combine(string baseUrl, string suffix, bool allowUnrooted = false)
Parameters
Type Name Description
String baseUrl

Must be an absolute path, unless allowUnrooted is set true.

String suffix

Cannot be an absolute path.

Boolean allowUnrooted
Returns
Type Description
String

ResolveApplicationRoot(String)

Try to resolve a the application-root url based on a pre-provided URL stem which may or may not contain noise.

Example of usage is asking user for URL to the CRM website. The user will typically copy paste from the browser: http://server.com/virtualdir/default.aspx?lotsOfParameters

They may copy things from config-files http://server.com/virtualdir/remote/Services75

Or the link may actually be correctly formatted: http://server.com/virtualdir/

From any of these inputs we want to be able find the appliaction root.

Declaration
public static string ResolveApplicationRoot(string providedUrl)
Parameters
Type Name Description
String providedUrl
Returns
Type Description
String

ResolveServiceUrl(String, String)

Resolve the location of a service based on a URL which represents a part of the current application, and which may contains "noise".

Declaration
public static string ResolveServiceUrl(string providedUrl, string serviceSuffix)
Parameters
Type Name Description
String providedUrl

URL which may or may not contain noise.

String serviceSuffix

Service-suffix from application-root.

Returns
Type Description
String
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top