Packagegs.util
Classpublic class URLUtils

The URLUtils class contains utility methods for working with urls.



Public Methods
 MethodDefined by
  
getFullURL(rootURL:String, url:String):String
[static] Converts a potentially relative URL to a full qualified URL.
URLUtils
  
getPort(url:String):int
[static] Get the port number.
URLUtils
  
getProtocol(url:String):String
[static] Get the protocol from a url.
URLUtils
  
getServerName(url:String):String
[static] Get the server name out of a url.
URLUtils
  
getServerNameWithPort(url:String):String
[static] Get the server name and port from a url.
URLUtils
  
isHTTP(url:String):Boolean
[static] Whether or not a url is http.
URLUtils
  
isHTTPS(url:String):Boolean
[static] Whether or not the url is https.
URLUtils
Method detail
getFullURL()method
public static function getFullURL(rootURL:String, url:String):String

Converts a potentially relative URL to a full qualified URL.

If the URL is not relative, it is just returned as is. If the URL starts with a slash, the host and port from the root URL are prepended. Otherwise, the host, port, and path are prepended.

Parameters
rootURL:String
 
url:String

Returns
String
getPort()method 
public static function getPort(url:String):int

Get the port number.

Parameters
url:String — The url.

Returns
int
getProtocol()method 
public static function getProtocol(url:String):String

Get the protocol from a url.

Parameters
url:String — The url.

Returns
String
getServerName()method 
public static function getServerName(url:String):String

Get the server name out of a url.

Parameters
url:String — The url.

Returns
String
getServerNameWithPort()method 
public static function getServerNameWithPort(url:String):String

Get the server name and port from a url.

Parameters
url:String — The url.

Returns
String
isHTTP()method 
public static function isHTTP(url:String):Boolean

Whether or not a url is http.

Parameters
url:String — The url.

Returns
Boolean
isHTTPS()method 
public static function isHTTPS(url:String):Boolean

Whether or not the url is https.

Parameters
url:String — The url.

Returns
Boolean