org.osgi.service.url

Class AbstractURLStreamHandlerService

public abstract class AbstractURLStreamHandlerService extends URLStreamHandler implements URLStreamHandlerService

Abstract implementation of the URLStreamHandlerService interface. All the methods simply invoke the corresponding methods on java.net.URLStreamHandler except for parseURL and setURL, which use the URLStreamHandlerSetter parameter. Subclasses of this abstract class should not need to override the setURL and parseURL(URLStreamHandlerSetter,...) methods.

Version: $Revision: 1.8 $

Field Summary
protected URLStreamHandlerSetterrealHandler
The URLStreamHandlerSetter object passed to the parseURL method.
Method Summary
booleanequals(URL u1, URL u2)
This method calls super.equals(URL,URL).
intgetDefaultPort()
This method calls super.getDefaultPort.
InetAddressgetHostAddress(URL u)
This method calls super.getHostAddress.
inthashCode(URL u)
This method calls super.hashCode(URL).
booleanhostsEqual(URL u1, URL u2)
This method calls super.hostsEqual.
abstract URLConnectionopenConnection(URL u)
voidparseURL(URLStreamHandlerSetter realHandler, URL u, String spec, int start, int limit)
Parse a URL using the URLStreamHandlerSetter object.
booleansameFile(URL u1, URL u2)
This method calls super.sameFile.
protected voidsetURL(URL u, String proto, String host, int port, String file, String ref)
This method calls realHandler.setURL(URL,String,String,int,String,String).
protected voidsetURL(URL u, String proto, String host, int port, String auth, String user, String path, String query, String ref)
This method calls realHandler.setURL(URL,String,String,int,String,String,String,String).
StringtoExternalForm(URL u)
This method calls super.toExternalForm.

Field Detail

realHandler

protected URLStreamHandlerSetter realHandler
The URLStreamHandlerSetter object passed to the parseURL method.

Method Detail

equals

public boolean equals(URL u1, URL u2)
This method calls super.equals(URL,URL).

See Also: "java.net.URLStreamHandler.equals(URL,URL)"

getDefaultPort

public int getDefaultPort()
This method calls super.getDefaultPort.

See Also: "java.net.URLStreamHandler.getDefaultPort"

getHostAddress

public InetAddress getHostAddress(URL u)
This method calls super.getHostAddress.

See Also: "java.net.URLStreamHandler.getHostAddress"

hashCode

public int hashCode(URL u)
This method calls super.hashCode(URL).

See Also: "java.net.URLStreamHandler.hashCode(URL)"

hostsEqual

public boolean hostsEqual(URL u1, URL u2)
This method calls super.hostsEqual.

See Also: "java.net.URLStreamHandler.hostsEqual"

openConnection

public abstract URLConnection openConnection(URL u)

See Also: "java.net.URLStreamHandler.openConnection"

parseURL

public void parseURL(URLStreamHandlerSetter realHandler, URL u, String spec, int start, int limit)
Parse a URL using the URLStreamHandlerSetter object. This method sets the realHandler field with the specified URLStreamHandlerSetter object and then calls parseURL(URL,String,int,int).

Parameters: realHandler The object on which the setURL method must be invoked for the specified URL.

See Also: "java.net.URLStreamHandler.parseURL"

sameFile

public boolean sameFile(URL u1, URL u2)
This method calls super.sameFile.

See Also: "java.net.URLStreamHandler.sameFile"

setURL

protected void setURL(URL u, String proto, String host, int port, String file, String ref)

Deprecated: This method is only for compatibility with handlers written for JDK 1.1.

This method calls realHandler.setURL(URL,String,String,int,String,String).

See Also: "java.net.URLStreamHandler.setURL(URL,String,String,int,String,String)"

setURL

protected void setURL(URL u, String proto, String host, int port, String auth, String user, String path, String query, String ref)
This method calls realHandler.setURL(URL,String,String,int,String,String,String,String).

See Also: "java.net.URLStreamHandler.setURL(URL,String,String,int,String,String,String,String)"

toExternalForm

public String toExternalForm(URL u)
This method calls super.toExternalForm.

See Also: "java.net.URLStreamHandler.toExternalForm"