Class ContextProtocolHandler

  • All Implemented Interfaces:
    org.osgi.service.url.URLStreamHandlerService

    public class ContextProtocolHandler
    extends org.osgi.service.url.AbstractURLStreamHandlerService
    The ContextProtocolHandler is a simple extension of the OSGi provided AbstractURLStreamHandlerService which simply returns an instance of the ContextConnection when trying to open the connection of the URL.
    • 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 - The LaunchpadContentProvider to which requests for content access are delegated.
    • Method Detail

      • openConnection

        public URLConnection openConnection​(URL url)
        Returns an instance of the ContextConnection class to access the content of the url.
        Specified by:
        openConnection in interface org.osgi.service.url.URLStreamHandlerService
        Specified by:
        openConnection in class org.osgi.service.url.AbstractURLStreamHandlerService
        Parameters:
        url - The URL whose content is requested.