BiUri
This class is used to define a Universal Resource Identifier (URI). This is sometimes also known as a Uniform Resource Locator (URL). A URI is used to describe the location and source of external files. A URI is only a representation of the string format describing the URI. It does not know how to lookup the information the URI might point at.
A general URI has the following format. Below this is a list of what part of the URI maps to what property.
http://user:password@www.domain.com:80/dir/file.html?param0=value=0;param1=value1#fragment
scheme - http
userInfo - user:password
host - www.domain.com
port - 80
path - /dir/file.html
dirPath - /dir/
query - ?param0=value=0;param1=value1 fragment - #fragment
getParam("param0") - value0
getParam("param1") - value1
href - http://user:password@www.domain.com:80/dir/file.html?param0=value=0;param1=value1#fragment
This class extends BiObject and therefore all methods and fields available for BiObject are also available for BiUri .
Constructor
new BiUri ( [ sBase [ ,sRel ] ] )
Parameters
| Name | Type | Optional | Default | Descripton |
sBase | String | ![]() | The base URI | |
sRel | String | ![]() | The URI relative to the base URI. If this describes an absolute URI then the base URI will be replaced. |
Properties
Methods
| Name | Description |
addParam | Adds a param with a given name and value. This is similar to setParam except that it does not overwrite existing paramaters with the same name. |
getParam | Gets the value for a param. This returns undefined if the param is not present. This returns null if the param is present but it does not have a value associated with it. |
getParams | Returns all the params with the given name |
hasParam | Whether the URI has a param with the given name |
removeParam | Removes the params with the given param name |
setParam | Sets the value for a param. |
Events
None.
Static Methods
None.
Static Fields
None.
Remarks
None.
Method Details
addParam
Adds a param with a given name and value. This is similar to setParam except that it does not overwrite existing paramaters with the same name.
Syntax
object.addParam ( sName,sValue ) Parameters
| Name | Type | Optional | Default | Descripton |
sName | String | The name of the param | ||
sValue | String | The value of the param |
Return Type
void
getParam
Gets the value for a param. This returns undefined if the param is not present. This returns null if the param is present but it does not have a value associated with it.
Syntax
object.getParam ( sName ) Parameters
| Name | Type | Optional | Default | Descripton |
sName | String | The name of the param |
Return Type
String
getParams
Returns all the params with the given name
Syntax
object.getParams ( sName ) Parameters
| Name | Type | Optional | Default | Descripton |
sName | String | The name of the params to get. |
Return Type
String[]
hasParam
Whether the URI has a param with the given name
Syntax
object.hasParam ( sName ) Parameters
| Name | Type | Optional | Default | Descripton |
sName | String | The name of the param to check for |
Return Type
Boolean
removeParam
Removes the params with the given param name
Syntax
object.removeParam ( sName ) Parameters
| Name | Type | Optional | Default | Descripton |
sName | String | The name of the param to remove |
Return Type
void
setParam
Sets the value for a param.
Syntax
object.setParam ( sName,sValue ) Parameters
| Name | Type | Optional | Default | Descripton |
sName | String | The name of the param | ||
sValue | String | The value of the param |
Return Type
void
