| Package | system |
| Class | public class URI |
| Inheritance | URI Object |
note:
based on RFC 3986
examples of valid URIs :
ftp://ftp.is.co.za/rfc/rfc1808.txt
http://www.ietf.org/rfc/rfc2396.txt
ldap://[2001:db8::7]/c=GB?objectClass?one
mailto:John.Doe@example.com
news:comp.infosystems.www.servers.unix
tel:+1-816-555-1212
telnet://192.0.2.16:80/
urn:oasis:names:specification:docbook:dtd:xml:4.1.2
| Property | Defined By | ||
|---|---|---|---|
| authority : String [read-only]
Indicates the authority of the URI. | URI | ||
| fragment : String [read-only]
Indicates the fragment expression of the URI. | URI | ||
| greedy : Boolean [static]
Allows to alter the tring representation of the URI
ex:
for a raw URI "http://www.domain.com/path/file.html?"
after parsing
if greedy render as
"http://www.domain.com/path/file.html"
if not greedy render as
"http://www.domain.com/path/file.html?"
| URI | ||
| host : String
Determinaes the host of the URI. | URI | ||
| path : String
Determinates the path of the URI. | URI | ||
| port : int
Determinates the port of the URI. | URI | ||
| query : String
Determinates the encoded URI query, not including the ?. | URI | ||
| scheme : String
Determinates the scheme of the URI. | URI | ||
| source : String [read-only]
Original string source of the URI
| URI | ||
| strict : Boolean = true [static]
Allows to support deprecated behaviour or not
ex: with userinfo
if strict, we do not display the password
if not strict we display the password
| URI | ||
| userinfo : String [read-only]
Indicates the user info expression of the URI. | URI | ||
| Method | Defined By | ||
|---|---|---|---|
URI(any:*, relativeURI:String)
Creates a new URI instance. | URI | ||
getParameter(name:String):*
Returns the first value for a given cgi parameter or undefined if the given parameter name does not appear in the query string. | URI | ||
Indicates the Map used in the URI to set the parameters of the query. | URI | ||
hasFragment():Boolean
Indicates whether the fragment string has been set. | URI | ||
hasParameter(name:String):Boolean
Indicates whether the specified parameter name exist in the query. | URI | ||
hasQuery():Boolean
Indicates whether the query string has been set. | URI | ||
isDomainAddress(str:String):Boolean [static]
Indicates if the uri is a domain address
note:
see: http://www.ietf.org/rfc/rfc1034.txt
3.5. | URI | ||
isIPv4Address(str:String):Boolean [static]
syntax:
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet
dec-octet = DIGIT ; 0-9
/ %x31-39 DIGIT ; 10-99
/ "1" 2DIGIT ; 100-199
/ "2" %x30-34 DIGIT ; 200-249
/ "25" %x30-35 ; 250-255
| URI | ||
isUNC():Boolean
Indicates if the URI is UNC. | URI | ||
isValidHost(str:String):Boolean [static]
Indicates if the specified host expression is valid (ipv4 or domain address). | URI | ||
isValidPort(num:int):Boolean [static]
Indicates if the specified port is valid. | URI | ||
isValidScheme(str:String):Boolean [static]
Indicates if the scheme of the uri is valid. | URI | ||
removeAllParameters():void
Removes all the parameters in the query. | URI | ||
removeParameter(name:String):void
Removes the named query parameter. | URI | ||
setParameterValue(name:String, value:*):void
Sets the values of the named query parameters, clearing previous values for that key. | URI | ||
toString():String
Returns the String representation of the object. | URI | ||
valueOf():String
Returns the primitive value of the object. | URI | ||
| authority | property |
authority:String [read-only] Indicates the authority of the URI. syntax:
authority = [ userinfo "@" ] host [ ":" port ]
public function get authority():String| fragment | property |
fragment:String [read-only] Indicates the fragment expression of the URI.
public function get fragment():String| greedy | property |
public static var greedy:BooleanAllows to alter the tring representation of the URI ex: for a raw URI "http://www.domain.com/path/file.html?" after parsing if greedy render as "http://www.domain.com/path/file.html" if not greedy render as "http://www.domain.com/path/file.html?"
| host | property |
host:StringDeterminaes the host of the URI.
public function get host():String public function set host(value:String):void| path | property |
path:StringDeterminates the path of the URI.
public function get path():String public function set path(value:String):void| port | property |
port:intDeterminates the port of the URI.
public function get port():int public function set port(value:int):void| query | property |
query:StringDeterminates the encoded URI query, not including the ?. You can set a query with a string who not including the ? character, ex : "a=1&b=2".
public function get query():String public function set query(value:String):void| scheme | property |
scheme:StringDeterminates the scheme of the URI.
public function get scheme():String public function set scheme(value:String):void| source | property |
source:String [read-only] Original string source of the URI
public function get source():String| strict | property |
public static var strict:Boolean = trueAllows to support deprecated behaviour or not
ex: with userinfo
| userinfo | property |
userinfo:String [read-only] Indicates the user info expression of the URI.
public function get userinfo():String| URI | () | Constructor |
public function URI(any:*, relativeURI:String)Creates a new URI instance.
Parametersany:* — An URI object or a String expression to initialize the instance.
| |
relativeURI:String — The relative URI reference.
|
| getParameter | () | method |
public function getParameter(name:String):*Returns the first value for a given cgi parameter or undefined if the given parameter name does not appear in the query string.
Parameters
name:String — The parameter to get values for.
|
* — the first value for a given cgi parameter or undefined if the given parameter name does not appear in the query string.
|
| getQueryMap | () | method |
public function getQueryMap():MapIndicates the Map used in the URI to set the parameters of the query.
ReturnsMap |
| hasFragment | () | method |
public function hasFragment():BooleanIndicates whether the fragment string has been set.
ReturnsBoolean |
| hasParameter | () | method |
public function hasParameter(name:String):BooleanIndicates whether the specified parameter name exist in the query.
Parameters
name:String |
Boolean |
| hasQuery | () | method |
public function hasQuery():BooleanIndicates whether the query string has been set.
ReturnsBoolean |
| isDomainAddress | () | method |
public static function isDomainAddress(str:String):BooleanIndicates if the uri is a domain address
note:
see: http://www.ietf.org/rfc/rfc1034.txt
3.5. Preferred name syntax
[...]
The following syntax will result in fewer problems with many applications that use domain names (e.g., mail, TELNET).
<domain> ::= <subdomain> | " "
<subdomain> ::= <label> | <subdomain> "." <label>
<label> ::= <letter> [ [ <ldh-str> ] <let-dig> ]
<ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>
<let-dig-hyp> ::= <let-dig> | "-"
<let-dig> ::= <letter> | <digit>
<letter> ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case
<digit> ::= any one of the ten digits 0 through 9
Note that while upper and lower case letters are allowed in domain names, no significance is attached to the case.That is, two names with the same spelling but different case are to be treated as if identical.
The labels must follow the rules for ARPANET host names. They must start with a letter, end with a letter or digit, and have as interior characters only letters, digits, and hyphen. There are also some restrictions on the length. Labels must be 63 characters or less.
Parameters
str:String |
Boolean |
| isIPv4Address | () | method |
public static function isIPv4Address(str:String):Booleansyntax: IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet dec-octet = DIGIT ; 0-9 / %x31-39 DIGIT ; 10-99 / "1" 2DIGIT ; 100-199 / "2" %x30-34 DIGIT ; 200-249 / "25" %x30-35 ; 250-255
Parameters
str:String |
Boolean |
| isUNC | () | method |
public function isUNC():BooleanIndicates if the URI is UNC.
ReturnsBoolean |
| isValidHost | () | method |
public static function isValidHost(str:String):BooleanIndicates if the specified host expression is valid (ipv4 or domain address).
Parameters
str:String |
Boolean |
| isValidPort | () | method |
public static function isValidPort(num:int):BooleanIndicates if the specified port is valid.
Parameters
num:int |
Boolean |
| isValidScheme | () | method |
public static function isValidScheme(str:String):BooleanIndicates if the scheme of the uri is valid.
RFC: 3.1. Scheme
[...]
Scheme names consist of a sequence of characters beginning with a
letter and followed by any combination of letters, digits, plus
("+"), period ("."), or hyphen ("-"). Although schemes are case-
insensitive, the canonical form is lowercase and documents that
specify schemes must do so with lowercase letters. An implementation
should accept uppercase letters as equivalent to lowercase in scheme
names (e.g., allow "HTTP" as well as "http") for the sake of
robustness but should only produce lowercase scheme names for consistency.
scheme = ALPHA ALPHA / DIGIT / "+" / "-" / "." )
Parameters
str:String |
Boolean |
| removeAllParameters | () | method |
public function removeAllParameters():voidRemoves all the parameters in the query.
| removeParameter | () | method |
public function removeParameter(name:String):voidRemoves the named query parameter.
Parameters
name:String — The parameter to remove.
|
| setParameterValue | () | method |
public function setParameterValue(name:String, value:*):voidSets the values of the named query parameters, clearing previous values for that key. Not new values will currently be moved to the end of the query string.
Parameters
name:String — The parameter to set.
| |
value:* — The new value.
|
| toString | () | method |
public function toString():StringReturns the String representation of the object.
ReturnsString — the String representation of the object.
|
| valueOf | () | method |
public function valueOf():StringReturns the primitive value of the object.
ReturnsString — the primivite value of the object.
|