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 java.net.URLStreamHandler implements URLStreamHandlerService
Abstract implementation of theURLStreamHandlerService
interface. All the methods simply invoke the corresponding methods onjava.net.URLStreamHandler
except forparseURL
andsetURL
, which use theURLStreamHandlerSetter
parameter. Subclasses of this abstract class should not need to override thesetURL
andparseURL(URLStreamHandlerSetter,...)
methods.- Author:
- $Id: 79cfc45d97b037436d50bda26111109bd5d42a37 $
-
-
Field Summary
Fields Modifier and Type Field Description protected URLStreamHandlerSetter
realHandler
TheURLStreamHandlerSetter
object passed to the parseURL method.
-
Constructor Summary
Constructors Constructor Description AbstractURLStreamHandlerService()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(java.net.URL u1, java.net.URL u2)
This method callssuper.equals(URL,URL)
.int
getDefaultPort()
This method callssuper.getDefaultPort
.java.net.InetAddress
getHostAddress(java.net.URL u)
This method callssuper.getHostAddress
.int
hashCode(java.net.URL u)
This method callssuper.hashCode(URL)
.boolean
hostsEqual(java.net.URL u1, java.net.URL u2)
This method callssuper.hostsEqual
.abstract java.net.URLConnection
openConnection(java.net.URL u)
void
parseURL(URLStreamHandlerSetter realHandler, java.net.URL u, java.lang.String spec, int start, int limit)
Parse a URL using theURLStreamHandlerSetter
object.boolean
sameFile(java.net.URL u1, java.net.URL u2)
This method callssuper.sameFile
.protected void
setURL(java.net.URL u, java.lang.String proto, java.lang.String host, int port, java.lang.String file, java.lang.String ref)
Deprecated.This method is only for compatibility with handlers written for JDK 1.1.protected void
setURL(java.net.URL u, java.lang.String proto, java.lang.String host, int port, java.lang.String auth, java.lang.String user, java.lang.String path, java.lang.String query, java.lang.String ref)
This method callsrealHandler.setURL(URL,String,String,int,String,String,String,String)
.java.lang.String
toExternalForm(java.net.URL u)
This method callssuper.toExternalForm
.
-
-
-
Field Detail
-
realHandler
protected volatile URLStreamHandlerSetter realHandler
TheURLStreamHandlerSetter
object passed to the parseURL method.
-
-
Method Detail
-
openConnection
public abstract java.net.URLConnection openConnection(java.net.URL u) throws java.io.IOException
- Specified by:
openConnection
in interfaceURLStreamHandlerService
- Specified by:
openConnection
in classjava.net.URLStreamHandler
- Throws:
java.io.IOException
- See Also:
- "java.net.URLStreamHandler.openConnection"
-
parseURL
public void parseURL(URLStreamHandlerSetter realHandler, java.net.URL u, java.lang.String spec, int start, int limit)
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
public java.lang.String toExternalForm(java.net.URL u)
This method callssuper.toExternalForm
.- Specified by:
toExternalForm
in interfaceURLStreamHandlerService
- Overrides:
toExternalForm
in classjava.net.URLStreamHandler
- See Also:
- "java.net.URLStreamHandler.toExternalForm"
-
equals
public boolean equals(java.net.URL u1, java.net.URL u2)
This method callssuper.equals(URL,URL)
.- Specified by:
equals
in interfaceURLStreamHandlerService
- Overrides:
equals
in classjava.net.URLStreamHandler
- See Also:
- "java.net.URLStreamHandler.equals(URL,URL)"
-
getDefaultPort
public int getDefaultPort()
This method callssuper.getDefaultPort
.- Specified by:
getDefaultPort
in interfaceURLStreamHandlerService
- Overrides:
getDefaultPort
in classjava.net.URLStreamHandler
- See Also:
- "java.net.URLStreamHandler.getDefaultPort"
-
getHostAddress
public java.net.InetAddress getHostAddress(java.net.URL u)
This method callssuper.getHostAddress
.- Specified by:
getHostAddress
in interfaceURLStreamHandlerService
- Overrides:
getHostAddress
in classjava.net.URLStreamHandler
- See Also:
- "java.net.URLStreamHandler.getHostAddress"
-
hashCode
public int hashCode(java.net.URL u)
This method callssuper.hashCode(URL)
.- Specified by:
hashCode
in interfaceURLStreamHandlerService
- Overrides:
hashCode
in classjava.net.URLStreamHandler
- See Also:
- "java.net.URLStreamHandler.hashCode(URL)"
-
hostsEqual
public boolean hostsEqual(java.net.URL u1, java.net.URL u2)
This method callssuper.hostsEqual
.- Specified by:
hostsEqual
in interfaceURLStreamHandlerService
- Overrides:
hostsEqual
in classjava.net.URLStreamHandler
- See Also:
- "java.net.URLStreamHandler.hostsEqual"
-
sameFile
public boolean sameFile(java.net.URL u1, java.net.URL u2)
This method callssuper.sameFile
.- Specified by:
sameFile
in interfaceURLStreamHandlerService
- Overrides:
sameFile
in classjava.net.URLStreamHandler
- See Also:
- "java.net.URLStreamHandler.sameFile"
-
setURL
protected void setURL(java.net.URL u, java.lang.String proto, java.lang.String host, int port, java.lang.String file, java.lang.String ref)
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 classjava.net.URLStreamHandler
- See Also:
- "java.net.URLStreamHandler.setURL(URL,String,String,int,String,String)"
-
setURL
protected void setURL(java.net.URL u, java.lang.String proto, java.lang.String host, int port, java.lang.String auth, java.lang.String user, java.lang.String path, java.lang.String query, java.lang.String ref)
This method callsrealHandler.setURL(URL,String,String,int,String,String,String,String)
.- Overrides:
setURL
in classjava.net.URLStreamHandler
- See Also:
- "java.net.URLStreamHandler.setURL(URL,String,String,int,String,String,String,String)"
-
-