Libraries anvil net URL

class URL
extends anvil.lang.object
Uniform Resource Locator. Class URL represents a URL address, a pointer to a "resource" on the World Wide Web.

Constructor
URL(string context)
URL(string context, string ref)
URL(url context, string ref)
Creates and returns a new URL, or null if it was invalid.


Methods

InetAddress getAddress()
Returns the internet address refererred by this URL.
Returns internet address
Throws UnknownHost -  If specified host is invalid

string getFile()
Returns the file name of this URL.
Returns file name

string getHost()
Returns the host name name of this URL, if applicable.
Returns host name

int getPort()
Returns the port number of this URL.
Returns the port number

string getProtocol()
Returns the protocol name this URL.
Returns the protocol name

string getRef()
Returns the reference (anchor) of this URL.
Returns the reference (anchor) of this URL.

URLConnection open()
Opens and returns a connection to this URL.
Returns url connection
Throws IOError -  If an IO error occured

InputStream openStream()
InputStream openStream(postParameters...)
Opens and returns a connection to this URL.
Returns input stream
Throws IOError -  If an IO error occured

boolean sameFile(string url)
boolean sameFile(URL url)
Checks if this url is equal to given parameter (excluding the "ref" field).
Parameters url -  the url to compare against.
Returns true if they reference the same remote object; false otherwise.