Package org.osgi.service.url
Class AbstractURLStreamHandlerService
java.lang.Object
java.net.URLStreamHandler
org.osgi.service.url.AbstractURLStreamHandlerService
- All Implemented Interfaces:
URLStreamHandlerService
@ConsumerType
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.-
Field Summary
Modifier and TypeFieldDescriptionprotected URLStreamHandlerSetter
TheURLStreamHandlerSetter
object passed to the parseURL method. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
This method callssuper.equals(URL,URL)
.int
This method callssuper.getDefaultPort
.This method callssuper.getHostAddress
.int
This method callssuper.hashCode(URL)
.boolean
hostsEqual
(URL u1, URL u2) This method callssuper.hostsEqual
.abstract URLConnection
void
parseURL
(URLStreamHandlerSetter realHandler, URL u, String spec, int start, int limit) Parse a URL using theURLStreamHandlerSetter
object.boolean
This method callssuper.sameFile
.protected void
Deprecated.This method is only for compatibility with handlers written for JDK 1.1.protected void
setURL
(URL u, String proto, String host, int port, String auth, String user, String path, String query, String ref) This method callsrealHandler.setURL(URL,String,String,int,String,String,String,String)
.This method callssuper.toExternalForm
.Methods inherited from class java.net.URLStreamHandler
openConnection, parseURL
-
Field Details
-
realHandler
TheURLStreamHandlerSetter
object passed to the parseURL method.
-
-
Constructor Details
-
AbstractURLStreamHandlerService
public AbstractURLStreamHandlerService()
-
-
Method Details
-
openConnection
- Specified by:
openConnection
in interfaceURLStreamHandlerService
- Specified by:
openConnection
in classURLStreamHandler
- Throws:
IOException
- See Also:
-
- "java.net.URLStreamHandler.openConnection"
-
parseURL
Parse a URL using theURLStreamHandlerSetter
object. This method sets therealHandler
field with the specifiedURLStreamHandlerSetter
object and then callsparseURL(URL,String,int,int)
.- Specified by:
parseURL
in interfaceURLStreamHandlerService
- Parameters:
realHandler
- The object on which thesetURL
method must be invoked for the specified URL.- See Also:
-
- "java.net.URLStreamHandler.parseURL"
-
toExternalForm
This method callssuper.toExternalForm
.- Specified by:
toExternalForm
in interfaceURLStreamHandlerService
- Overrides:
toExternalForm
in classURLStreamHandler
- See Also:
-
- "java.net.URLStreamHandler.toExternalForm"
-
equals
This method callssuper.equals(URL,URL)
.- Specified by:
equals
in interfaceURLStreamHandlerService
- Overrides:
equals
in classURLStreamHandler
- See Also:
-
- "java.net.URLStreamHandler.equals(URL,URL)"
-
getDefaultPort
public int getDefaultPort()This method callssuper.getDefaultPort
.- Specified by:
getDefaultPort
in interfaceURLStreamHandlerService
- Overrides:
getDefaultPort
in classURLStreamHandler
- See Also:
-
- "java.net.URLStreamHandler.getDefaultPort"
-
getHostAddress
This method callssuper.getHostAddress
.- Specified by:
getHostAddress
in interfaceURLStreamHandlerService
- Overrides:
getHostAddress
in classURLStreamHandler
- See Also:
-
- "java.net.URLStreamHandler.getHostAddress"
-
hashCode
This method callssuper.hashCode(URL)
.- Specified by:
hashCode
in interfaceURLStreamHandlerService
- Overrides:
hashCode
in classURLStreamHandler
- See Also:
-
- "java.net.URLStreamHandler.hashCode(URL)"
-
hostsEqual
This method callssuper.hostsEqual
.- Specified by:
hostsEqual
in interfaceURLStreamHandlerService
- Overrides:
hostsEqual
in classURLStreamHandler
- See Also:
-
- "java.net.URLStreamHandler.hostsEqual"
-
sameFile
This method callssuper.sameFile
.- Specified by:
sameFile
in interfaceURLStreamHandlerService
- Overrides:
sameFile
in classURLStreamHandler
- See Also:
-
- "java.net.URLStreamHandler.sameFile"
-
setURL
Deprecated.This method is only for compatibility with handlers written for JDK 1.1.This method callsrealHandler.setURL(URL,String,String,int,String,String)
.- Overrides:
setURL
in classURLStreamHandler
- 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 callsrealHandler.setURL(URL,String,String,int,String,String,String,String)
.- Overrides:
setURL
in classURLStreamHandler
- See Also:
-
- "java.net.URLStreamHandler.setURL(URL,String,String,int,String,String,String,String)"
-