| java.lang.Object | |
| ↳ | java.net.URLStreamHandler |
The abstract class URLStreamHandler is the base for all classes which
can handle the communication with a URL object over a particular protocol
type.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Returns true if
a and b have the same protocol, host,
port, file, and reference.
| |||||||||||
Returns the default port of the protocol used by the handled URL.
| |||||||||||
Returns the host address of
url.
| |||||||||||
Returns the hash code of
url.
| |||||||||||
Returns true if the hosts of
a and b are equal.
| |||||||||||
Establishes a new connection to the resource specified by the URL
u using the given proxy.
| |||||||||||
Establishes a new connection to the resource specified by the URL
u.
| |||||||||||
Parses the clear text URL in
str into a URL object.
| |||||||||||
Returns true if
a and b have the same protocol, host,
port and file.
| |||||||||||
This method was deprecated
in API level 1.
Use setURL(URL, String String, int, String, String, String,
String, String) instead.
| |||||||||||
Sets the fields of the URL
u to the values of the supplied
arguments.
| |||||||||||
Returns the clear text representation of a given URL using HTTP format.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Returns true if a and b have the same protocol, host,
port, file, and reference.
| Parameters | |
|---|---|
a |
URL
|
b |
URL
|
| Returns | |
|---|---|
boolean |
|
Returns the default port of the protocol used by the handled URL. The
default implementation always returns -1.
| Returns | |
|---|---|
int |
|
Returns the hash code of url.
| Parameters | |
|---|---|
url |
URL
|
| Returns | |
|---|---|
int |
|
Returns true if the hosts of a and b are equal.
| Parameters | |
|---|---|
a |
URL
|
b |
URL
|
| Returns | |
|---|---|
boolean |
|
Establishes a new connection to the resource specified by the URL u using the given proxy. Since different protocols also have
unique ways of connecting, it must be overwritten by the subclass.
| Parameters | |
|---|---|
u |
URL:
the URL to the resource where a connection has to be opened. |
proxy |
Proxy:
the proxy that is used to make the connection. |
| Returns | |
|---|---|
URLConnection |
the opened URLConnection to the specified resource. |
| Throws | |
|---|---|
IOException |
if an I/O error occurs during opening the connection. |
IllegalArgumentException |
if any argument is null or the type of proxy is
wrong. |
UnsupportedOperationException |
if the protocol handler doesn't support this method. |
Establishes a new connection to the resource specified by the URL u. Since different protocols also have unique ways of connecting, it
must be overwritten by the subclass.
| Parameters | |
|---|---|
u |
URL:
the URL to the resource where a connection has to be opened. |
| Returns | |
|---|---|
URLConnection |
the opened URLConnection to the specified resource. |
| Throws | |
|---|---|
IOException |
if an I/O error occurs during opening the connection. |
Parses the clear text URL in str into a URL object. URL strings
generally have the following format:
http://www.company.com/java/file1.java#reference
The string is parsed in HTTP format. If the protocol has a different URL format this method must be overridden.
| Parameters | |
|---|---|
url |
URL:
the URL to fill in the parsed clear text URL parts. |
spec |
String:
the URL string that is to be parsed. |
start |
int:
the string position from where to begin parsing. |
end |
int:
the string position to stop parsing. |
See also:
Returns true if a and b have the same protocol, host,
port and file.
| Parameters | |
|---|---|
a |
URL
|
b |
URL
|
| Returns | |
|---|---|
boolean |
|
This method was deprecated
in API level 1.
Use setURL(URL, String String, int, String, String, String,
String, String) instead.
Sets the fields of the URL u to the values of the supplied
arguments.
| Parameters | |
|---|---|
u |
URL:
the non-null URL object to be set. |
protocol |
String:
the protocol. |
host |
String:
the host name. |
port |
int:
the port number. |
file |
String:
the file component. |
ref |
String:
the reference. |
Sets the fields of the URL u to the values of the supplied
arguments.
| Parameters | |
|---|---|
u |
URL
|
protocol |
String
|
host |
String
|
port |
int
|
authority |
String
|
userInfo |
String
|
path |
String
|
query |
String
|
ref |
String
|
Returns the clear text representation of a given URL using HTTP format.
| Parameters | |
|---|---|
url |
URL:
the URL object to be converted. |
| Returns | |
|---|---|
String |
the clear text representation of the specified URL. |