Class ContextProtocolHandler
- java.lang.Object
-
- java.net.URLStreamHandler
-
- org.osgi.service.url.AbstractURLStreamHandlerService
-
- org.apache.sling.launchpad.base.impl.ContextProtocolHandler
-
- All Implemented Interfaces:
org.osgi.service.url.URLStreamHandlerService
public class ContextProtocolHandler extends org.osgi.service.url.AbstractURLStreamHandlerService
TheContextProtocolHandler
is a simple extension of the OSGi providedAbstractURLStreamHandlerService
which simply returns an instance of theContextConnection
when trying to open the connection of the URL.
-
-
Constructor Summary
Constructors Constructor Description ContextProtocolHandler(org.apache.sling.launchpad.api.LaunchpadContentProvider resourceProvider)
Creates an instance of this protocol handler setting the servlet context which is queried to access content.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description URLConnection
openConnection(URL url)
Returns an instance of theContextConnection
class to access the content of theurl
.-
Methods inherited from class org.osgi.service.url.AbstractURLStreamHandlerService
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, parseURL, sameFile, setURL, setURL, toExternalForm
-
Methods inherited from class java.net.URLStreamHandler
openConnection, parseURL
-
-
-
-
Constructor Detail
-
ContextProtocolHandler
public ContextProtocolHandler(org.apache.sling.launchpad.api.LaunchpadContentProvider resourceProvider)
Creates an instance of this protocol handler setting the servlet context which is queried to access content.- Parameters:
resourceProvider
- TheLaunchpadContentProvider
to which requests for content access are delegated.
-
-
Method Detail
-
openConnection
public URLConnection openConnection(URL url)
Returns an instance of theContextConnection
class to access the content of theurl
.- Specified by:
openConnection
in interfaceorg.osgi.service.url.URLStreamHandlerService
- Specified by:
openConnection
in classorg.osgi.service.url.AbstractURLStreamHandlerService
- Parameters:
url
- The URL whose content is requested.
-
-