class URLHandlerImpl

A URLHandlerImpl is base class for URL protocol-specific handlers

Inheritance:


Public Methods

virtual ~URLHandlerImpl ()
Destroys this object
virtual void parseURL (URL& url, const string& spec) const
Parses the string spec to set the fields in the URL
virtual void initURL (URL& url, const string& host, int port, const string& file) const
Initializes the URL with the host, port and name of file
virtual string toExternalForm (const URL& url) const
Formats the URL to an external string
virtual URLConnection getURLConnection (const URL& url) const
Returns the URL connection given the URL

Protected Methods

URLHandlerImpl ()
Constructs this object
void setHost (URL& url, const string& host) const
Sets the host in the URL
void setPort (URL &url, int port) const
Sets the port in the URL
void setFile (URL& url, const string& file) const
Sets the file in the URL

Documentation

A URLHandlerImpl is base class for URL protocol-specific handlers. It provides methods such parsing the URL string representation, initializing the URL from a given string, returning the external format for the URL, and returning the default port for its protocol. In general this base class implments methods for the http protocol, which thus need to be overridden by the subclasses for file and ldap. URLHandlerImpls are created by the URLHandlerFactoryImpl which defines one URLHandlerImpl for each of the supported protocols: http, file or ldap.
virtual ~URLHandlerImpl()
Destroys this object

virtual void parseURL(URL& url, const string& spec) const
Parses the string spec to set the fields in the URL.
Throws:
MalformedURLException if the next token is not correct or
MalformedURLException if reading port failed
Parameters:
url - the URL
spec - string to be parsed
See Also:
URL(const string& url)
StringTokenizer(const string& source, ... )

virtual void initURL(URL& url, const string& host, int port, const string& file) const
Initializes the URL with the host, port and name of file.
Parameters:
url - URL to be initialized
host - name of the host
port - port number
file - the name of the file
See Also:
setHost(URL& url, const string& host)
setPort(URL &url, int port)
setFile(URL& url, const string& file)

virtual string toExternalForm(const URL& url) const
Formats the URL to an external string.
Returns:
string the external string format
Parameters:
url - the URL

virtual URLConnection getURLConnection(const URL& url) const
Returns the URL connection given the URL. Pure virtual method, must be supplied by protocol-specific handlers.
Returns:
the URL connection
Parameters:
url - the URL

URLHandlerImpl()
Constructs this object

void setHost(URL& url, const string& host) const
Sets the host in the URL.
Throws:
MalformedURLException if there is no host name
Parameters:
url - the URL
host - the name of the host
See Also:
setHost(URL& url, const string& host)

void setPort(URL &url, int port) const
Sets the port in the URL.
Throws:
MalformedURLException if port is less than zero
Parameters:
url - the URL
port - the port number

void setFile(URL& url, const string& file) const
Sets the file in the URL.
Throws:
MalformedURLException if port is less than zero
Parameters:
url - the URL
file - string the name of the file


Direct child classes:
LdapURLHandlerImpl
HttpURLHandlerImpl
FileURLHandlerImpl
Author:
Srilekha Mudumbai Abdelilah Essiari
Version:
1.1 00/11/01
See Also:
URL
URLConnection

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de