OSGi™ Core
Release 6

org.osgi.service.url
Interface URLStreamHandlerService

All Known Implementing Classes:
AbstractURLStreamHandlerService

@ConsumerType
public interface URLStreamHandlerService

Service interface with public versions of the protected java.net.URLStreamHandler methods.

The important differences between this interface and the URLStreamHandler class are that the setURL method is absent and the parseURL method takes a URLStreamHandlerSetter object as the first argument. Classes implementing this interface must call the setURL method on the URLStreamHandlerSetter object received in the parseURL method instead of URLStreamHandler.setURL to avoid a SecurityException.

See Also:
AbstractURLStreamHandlerService
"ThreadSafe"

Method Summary
 boolean equals(URL u1, URL u2)
           
 int getDefaultPort()
           
 InetAddress getHostAddress(URL u)
           
 int hashCode(URL u)
           
 boolean hostsEqual(URL u1, URL u2)
           
 URLConnection openConnection(URL u)
           
 void parseURL(URLStreamHandlerSetter realHandler, URL u, String spec, int start, int limit)
          Parse a URL.
 boolean sameFile(URL u1, URL u2)
           
 String toExternalForm(URL u)
           
 

Method Detail

openConnection

URLConnection openConnection(URL u)
                             throws IOException
Throws:
IOException
See Also:
"java.net.URLStreamHandler.openConnection"

parseURL

void parseURL(URLStreamHandlerSetter realHandler,
              URL u,
              String spec,
              int start,
              int limit)
Parse a URL. This method is called by the URLStreamHandler proxy, instead of java.net.URLStreamHandler.parseURL, passing a URLStreamHandlerSetter object.

Parameters:
realHandler - The object on which setURL must be invoked for this URL.
See Also:
"java.net.URLStreamHandler.parseURL"

toExternalForm

String toExternalForm(URL u)
See Also:
"java.net.URLStreamHandler.toExternalForm"

equals

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

getDefaultPort

int getDefaultPort()
See Also:
"java.net.URLStreamHandler.getDefaultPort"

getHostAddress

InetAddress getHostAddress(URL u)
See Also:
"java.net.URLStreamHandler.getHostAddress"

hashCode

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

hostsEqual

boolean hostsEqual(URL u1,
                   URL u2)
See Also:
"java.net.URLStreamHandler.hostsEqual"

sameFile

boolean sameFile(URL u1,
                 URL u2)
See Also:
"java.net.URLStreamHandler.sameFile"

OSGi™ Core
Release 6

Copyright © OSGi Alliance (2000, 2015). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0