# tinymce.util.URI

Namespace | tinymce.util
Class | URI

This class handles parsing, modification and serialization of URI/URL strings.

## Public Methods

Method | Defined By
--- | ---
URI(u:String, s:Object) Constucts a new URI instance. | URI
getURI(nh:Boolean):void Returns the full URI of the internal structure. | URI
setPath(p:string):void Sets the internal path part of the URI. | URI
toAbsolute(u:String, nh:Boolean):String Converts the specified URI into a absolute URI based on the current URI instance location. | URI
toAbsPath(base:String, path:String):void Converts a relative path into a absolute path. | URI
toRelative(u:String):String Converts the specified URI into a relative URI based on the current URI instance location. | URI
toRelPath(base:String, path:String):void Converts a absolute path into a relative path. | URI

## Method details

### URIconstructor

`public function URI(u:String, s:Object)`
Constucts a new URI instance.

#### Parameters

u:String | URI string to parse.
s:Object | Optional settings object.

### getURImethod

`public function getURI(nh:Boolean):void`
Returns the full URI of the internal structure.

#### Parameters

nh:Boolean | Optional no host and protocol part. Defaults to false.

### setPathmethod

`public function setPath(p:string):void`
Sets the internal path part of the URI.

#### Parameters

p:string | Path string to set.

### toAbsolutemethod

`public function toAbsolute(u:String, nh:Boolean):String`
Converts the specified URI into a absolute URI based on the current URI instance location.

#### Parameters

u:String | URI to convert into a relative path/URI.
nh:Boolean | No host and protocol prefix.

#### Returns

String - Absolute URI from the point specified in the current URI instance.

#### Example

### toAbsPathmethod

`public function toAbsPath(base:String, path:String):void`
Converts a relative path into a absolute path.

#### Parameters

base:String | Base point to convert the path from.
path:String | Relative path to convert into an absolute path.

### toRelativemethod

`public function toRelative(u:String):String`
Converts the specified URI into a relative URI based on the current URI instance location.

#### Parameters

u:String | URI to convert into a relative path/URI.

#### Returns

String - Relative URI from the point specified in the current URI instance.

#### Example

### toRelPathmethod

`public function toRelPath(base:String, path:String):void`
Converts a absolute path into a relative path.

#### Parameters

base:String | Base point to convert the path from.
path:String | Absolute path to convert into a relative path.