Class URL

Superclasses :
util::Error
lang::Object
lang::SelectiveClassCoding
Package :
net

This class encapsulates a URL

Source

Class summary
Methods inherited from util::Error
error(a) get_reason()
Variables inherited from util::Error
reason
Methods inherited from lang::Object
clone(seen) equals(other, seen) get_class() get_class_name() get_id() hash_code(depth, seen) is_instance(name)
Methods inherited from lang::SelectiveClassCoding
decode_obj(e) encode_obj(e) load_map() load_template()
Methods inherited from lang::ClassCoding
decode_obj(e) encode_obj(e) post_decode() pre_encode()
Methods defined in this class
close() convert_hex(s) extract_cgi_parameters() extract_hex(s) get_address() get_file() get_file_dir() get_file_last() get_port() get_protocol() get_ref() get_template() initially() make_cgi_string(cgi) open() parse(s) set_address(x) set_cgi_parameters(cgi) set_file(x) set_port(x) set_protocol(x) set_ref(x) set_relative(s) to_string()
Variables defined in this class
address file file_handle header port protocol ref

Method detail

close()

Close the file returned by Open().
Source

convert_hex(s)

Convert a CGI parameter string by extracting any encoded characters.
Source

extract_cgi_parameters()

Extract the cgi parameters from the file field.
Returns :
A table, representing the keys and values of the fields.
Source

extract_hex(s)

Create a CGI parameter string by adding any encoding necessary.
Source

get_address()

Get the address field.
Source

get_file()

Get the file field.
Source

get_file_dir()

Get the portion of the file name upto and including the last "/"
Source

get_file_last()

Get the last portion of the file name, ie that past the last "/"
Source

get_port()

Get the port field.
Source

get_protocol()

Get the protocol field.
Source

get_ref()

Get the ref field. This is &null if no ref is set.
Source

get_template()

Overrides get_template() in lang::SelectiveClassCoding
Source

initially()


make_cgi_string(cgi)

Create a CGI parameter string from a table
Source

open()

Open a file based on the address and the port and return it.
Source

parse(s)

Parse the fields of the URL object given the string s.
Source

set_address(x)

Set the address (host) field.
Source

set_cgi_parameters(cgi)

Amend the file field given a table of CGI parameters. The old parameter portion (if any) is discarded.
Parameters :
cgi - The table of keys/values.
Source

set_file(x)

Set the file field.
Source

set_port(x)

Set the port field.
Source

set_protocol(x)

Set the protocol field.
Source

set_ref(x)

Set the ref field.
Source

set_relative(s)

Amend the filename/reference given a relative URL, treating the current instance as a base URL.
Parameters :
s - The relative URL.
Source

to_string()

Overrides to_string(depth, seen) in lang::Object
Return a string representation of the URL.
Source

Variable detail

address


file


file_handle


header


port


protocol


ref