Package org.osgi.service.url
Interface URLStreamHandlerService
-
- All Known Implementing Classes:
AbstractURLStreamHandlerService
@ConsumerType public interface URLStreamHandlerService
Service interface with public versions of the protectedjava.net.URLStreamHandler
methods.The important differences between this interface and the
URLStreamHandler
class are that thesetURL
method is absent and theparseURL
method takes aURLStreamHandlerSetter
object as the first argument. Classes implementing this interface must call thesetURL
method on theURLStreamHandlerSetter
object received in theparseURL
method instead ofURLStreamHandler.setURL
to avoid aSecurityException
.- See Also:
AbstractURLStreamHandlerService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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 theURLStreamHandler
proxy, instead ofjava.net.URLStreamHandler.parseURL
, passing aURLStreamHandlerSetter
object.- Parameters:
realHandler
- The object on whichsetURL
must be invoked for this URL.- See Also:
- "java.net.URLStreamHandler.parseURL"
-
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)"
-
-