#include <URL.h>
Inheritance diagram for acdk::net::URL:
Public Member Functions | |
URL (IN(RString) protocol, IN(RString) host, IN(RString) file) | |
Constructs a URL and loads a protocol handler for the values passed in as arugments. | |
URL (IN(RString) protocol, IN(RString) host, int port, IN(RString) file, IN(RString) user=Nil, IN(RString) pass=Nil, IN(RURLStreamHandler) ph=Nil) | |
This method initializes a new instance of URL with the specified protocol, host, port, and file. | |
URL (IN(RURL) context, IN(RString) url, IN(RURLStreamHandler) ph=Nil) | |
This method parses a String representation of a URL within the context of an existing URL. | |
URL (IN(RString) url) | |
Initializes a URL from a complete string specification such as ". | |
virtual RString | getProtocol () |
Returns the protocol name of this URL. | |
virtual RString | getHost () |
Returns the hostname or IP address for this protocol. | |
virtual int | getPort () |
Returns the port number of this URL or -1 if the default port number is being used. | |
void | setPort (int portno) |
virtual RString | getFile () |
Returns the " portion of this URL. | |
void | setFile (IN(RString) fn) |
virtual RString | getUser () |
void | setUser (IN(RString) u) |
virtual RString | getPassword () |
void | setPassword (IN(RString) p) |
virtual RString | getRef () |
Returns the ref (sometimes called the ") portion of the URL. | |
void | setRef (IN(RString) r) |
virtual bool | equals (IN(RObject) url) |
Test another URL for equality with this one. | |
virtual bool | sameFile (IN(RURLInterface) url) |
Tests whether or not another URL refers to the same " as this one. | |
int | compareTo (IN(RObject) url) |
compares t objects Object::compareTo() UnsupportedOperationException | |
virtual RString | toExternalForm () |
Returns a String representing this URL. | |
virtual RString | toString () |
Returns a String representing this URL. | |
virtual RURLConnection | openConnection () |
Returns a URLConnection for this object created by calling the openConnection() method of the protocol handler. | |
RReader | openStream () |
This method returns an InputStream for this URL by first opening the connection, then calling the getInputStream() method against the connection. | |
RObject | getContent () |
Returns the contents of this URL as an object by first opening a connection, then calling the getContent() method against the connection. | |
virtual int | hashCode () |
This method returns a hash value for this object. | |
Static Public Member Functions | |
RString | fileAsUrlName (IN(RString) fileName) |
RString | fileAsUrlName (IN(acdk::io::RFile) file) |
Protected Member Functions | |
virtual void | set (IN(RString) protocol, IN(RString) host, int port, IN(RString) user, IN(RString) password, IN(RString) file, IN(RString) ref) |
This protected method is used by protocol handlers to set the values of the fields in this URL. | |
Private Member Functions | |
void | _URLinit (IN(RString) protocol, IN(RString) host, int port, IN(RString) user, IN(RString) pass, IN(RString) file, IN(RURLStreamHandler) ph) |
void | _URLbyContext (IN(RURL) context, IN(RString) url, IN(RURLStreamHandler) ph=Nil) |
Private Attributes | |
RString | protocol |
RString | host |
int | port |
RString | file |
RString | ref |
The # portion of the URL. | |
RString | user |
RString | password |
RURLStreamHandler | ph |
Friends | |
class | URLStreamHandler |
class | URL_initializer |
|
Constructs a URL and loads a protocol handler for the values passed in as arugments. Uses the default port for the protocol.
|
|
This method initializes a new instance of
Additionally, this method allows the caller to specify a protocol handler to use instead of the default. If this handler is specified, the caller must have the " permission (see
|
|
This method parses a String representation of a URL within the context of an existing URL. Principally this means that any fields not present the URL are inheritied from the context URL. This allows relative URL's to be easily constructed (***true?***). If the context argument is null, then a complete URL must be specified in the URL string. If the protocol parsed out of the URL is different from the context URL's protocol, then then URL String is also expected to be a complete URL.
Additionally, this method allows the caller to specify a protocol handler to use instead of the default. If this handler is specified, the caller must have the " permission (see
|
|
Initializes a URL from a complete string specification such as ". First the protocol name is parsed out of the string. Then a handler is located for that protocol and the parseURL() method of that protocol handler is used to parse the remaining fields.
|
|
|
|
|
|
compares t objects Object::compareTo() UnsupportedOperationException
Reimplemented from acdk::lang::Object. |
|
Test another URL for equality with this one. This will be true only if the argument is non-null and all of the fields in the URL's match exactly (ie, protocol, host, port, file, and ref). Overrides Object.equals().
Reimplemented from acdk::lang::Object. |
|
|
|
|
|
Returns the contents of this URL as an object by first opening a connection, then calling the getContent() method against the connection.
Implements acdk::net::URLInterface. |
|
Returns the " portion of this URL.
Implements acdk::net::URLInterface. |
|
Returns the hostname or IP address for this protocol.
Implements acdk::net::URLInterface. |
|
Implements acdk::net::URLInterface. |
|
Returns the port number of this URL or -1 if the default port number is being used.
Implements acdk::net::URLInterface. |
|
Returns the protocol name of this URL.
Implements acdk::net::URLInterface. |
|
Returns the ref (sometimes called the ") portion of the URL.
Implements acdk::net::URLInterface. |
|
Implements acdk::net::URLInterface. |
|
This method returns a hash value for this object.
Reimplemented from acdk::lang::Object. |
|
Returns a URLConnection for this object created by calling the openConnection() method of the protocol handler.
|
|
This method returns an InputStream for this URL by first opening the connection, then calling the getInputStream() method against the connection.
Implements acdk::net::URLInterface. |
|
Tests whether or not another URL refers to the same " as this one. This will be true if and only if the passed object is not null, is a URL, and matches all fields but the ref (ie, protocol, host, port, and file);
Implements acdk::net::URLInterface. |
|
This protected method is used by protocol handlers to set the values of the fields in this URL. This might be done in the parseURL method of that class.
|
|
|
|
|
|
|
|
|
|
|
|
Returns a String representing this URL. The String returned is created by calling the protocol handler's toExternalForm() method.
Implements acdk::net::URLInterface. |
|
Returns a String representing this URL. Identical to toExternalForm(). The value returned is created by the protocol handler's toExternalForm method. Overrides Object.toString()
Reimplemented from acdk::lang::Object. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The # portion of the URL.
|
|
|