class Akenti::URLHandlerImpl

A URLHandlerImpl is base class for URL protocol-specific handlers.

Public Methods

[more]virtual ~URLHandlerImpl ()
Destroys this object
[more]virtual void parseURL (URL& url, const string& spec) const
Parses the string spec to set the fields in the URL.
[more]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.
[more]virtual string toExternalForm (const URL& url) const
Formats the URL to an external string.
[more]virtual URLConnection getURLConnection (const URL& url) const
Returns the URL connection given the URL.

Protected Methods

[more] URLHandlerImpl ()
Constructs this object
[more]void setHost (URL& url, const string& host) const
Sets the host in the URL.
[more]void setPort (URL &url, int port) const
Sets the port in the URL.
[more]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.

ovirtual ~URLHandlerImpl()
Destroys this object

ovirtual 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, ... )

ovirtual 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)

ovirtual string toExternalForm(const URL& url) const
Formats the URL to an external string.

Parameters:
url - the URL
Returns:
string the external string format

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

Parameters:
url - the URL
Returns:
the URL connection

o URLHandlerImpl()
Constructs this object

ovoid 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)

ovoid 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

ovoid 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


This class has no child classes.
Author:
Srilekha Mudumbai Abdelilah Essiari
Version:
1.1 00/11/01
See Also:
URL
URLConnection

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.