indexing
description: "URLs for FTP resources"
status: "See note at end of class"
date: "$Date$"
revision: "$Revision$"
class interface
FTP_URL
create
make (a: STRING)
require URL
address_specified: a /= void and then not a.is_empty
ensure URL
address_set: address = a
default_port_set: port = default_port
no_proxy_set: proxy_information = void
feature
hash_code: INTEGER
NETWORK_RESOURCE_URL
ensure HASHABLE
good_hash_value: Result >= 0
host: STRING
NETWORK_RESOURCE_URL
location: STRING
URL
NETWORK_RESOURCE_URL
password: STRING
NETWORK_RESOURCE_URL
path: STRING
NETWORK_RESOURCE_URL
port: INTEGER
URL
proxy_host: STRING
URL
require URL
proxy_supported: is_proxy_supported
has_proxy: is_proxy_used
ensure URL
result_not_empty: Result /= void and then not Result.is_empty
proxy_port: INTEGER
URL
require URL
proxy_supported: is_proxy_supported
has_proxy: is_proxy_used
ensure URL
result_non_negative: Result >= 0
Service: STRING is "ftp"
username: STRING
NETWORK_RESOURCE_URL
feature
is_equal (other: like Current): BOOLEAN
other
NETWORK_RESOURCE_URL
require ANY
other_not_void: other /= void
ensure ANY
symmetric: Result implies other.is_equal (Current)
consistent: standard_is_equal (other) implies Result
feature
Default_port: INTEGER is 21
Has_username: BOOLEAN is True
proxy_host_ok (h: STRING): BOOLEAN
h
HOST_VALIDITY_CHECKER
require URL
proxy_supported: is_proxy_supported
is_correct: BOOLEAN
NETWORK_RESOURCE_URL
is_hashable: BOOLEAN
HASHABLE
ensure HASHABLE
ok_if_not_default: Result implies (Current /= default)
is_host_correct (h: STRING): BOOLEAN
h
NETWORK_RESOURCE_URL
is_password_accepted: BOOLEAN
NETWORK_RESOURCE_URL
is_path_correct (p: STRING): BOOLEAN
Is_proxy_supported: BOOLEAN is True
is_proxy_used: BOOLEAN
URL
feature
reset_proxy
URL
require URL
proxy_supported: is_proxy_supported
ensure URL
no_proxy_set: not is_proxy_used
port_reset: proxy_port = 0
set_password (pw: STRING)
NETWORK_RESOURCE_URL
require URL
password_accepted: is_password_accepted
non_empty_password: pw /= void and then not pw.is_empty
ensure then NETWORK_RESOURCE_URL
password_set: password = pw
set_port (port_no: INTEGER)
port_no
URL
require URL
port_non_negative: port_no >= 0
ensure URL
port_set: port = port_no
set_proxy (host: STRING; port_no: INTEGER)
hostport_no
URL
require URL
proxy_supported: is_proxy_supported
non_empty_host: host /= void and then not host.is_empty
host_valid: proxy_host_ok (host)
non_negative_port: port_no >= 0
ensure URL
host_set: proxy_host = host
port_set: proxy_port = port_no
set_proxy_information (pi: PROXY_INFORMATION)
pi
URL
require URL
proxy_supported: is_proxy_supported
ensure URL
proxy_information_set: proxy_information = pi
set_username (un: STRING)
NETWORK_RESOURCE_URL
require URL
username_ok: has_username
non_empty_username: un /= void and then not un.is_empty
ensure then NETWORK_RESOURCE_URL
username_set: username = un
invariant
ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
NETWORK_RESOURCE_URL
path_charset_defined: path_charset /= void and then not path_charset.is_empty
username_exists: username /= void
password_exists: password /= void
password_constraint: not password.is_empty implies not username.is_empty
URL
proxy_used_definition: is_proxy_used = (proxy_information /= void)
proxy_usage_constraint: is_proxy_used implies is_proxy_supported
end -- FTP_URL