Class AbstractClientlibServlet

  • All Implemented Interfaces:
    Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
    Direct Known Subclasses:
    ClientlibCategoryServlet, ClientlibServlet

    public abstract class AbstractClientlibServlet
    extends org.apache.sling.api.servlets.SlingSafeMethodsServlet
    Contains common functionality for the clientlib servlets.
    See Also:
    Serialized Form
    • Constructor Detail

      • AbstractClientlibServlet

        public AbstractClientlibServlet()
    • Method Detail

      • getClientlibService

        @NotNull
        protected abstract @NotNull ClientlibService getClientlibService()
      • deliverClientlib

        protected void deliverClientlib​(boolean get,
                                        org.apache.sling.api.SlingHttpServletRequest request,
                                        org.apache.sling.api.SlingHttpServletResponse response,
                                        ClientlibRef clientlibRef,
                                        String requestedHash,
                                        boolean minified)
                                 throws javax.jcr.RepositoryException,
                                        IOException
        Parameters:
        get - if false we serve a HEAD request, if true we serve a GET request
        requestedHash - the hash embedded in the URL that gives the requested version
        Throws:
        javax.jcr.RepositoryException
        IOException
      • makeUrl

        protected String makeUrl​(org.apache.sling.api.SlingHttpServletRequest request,
                                 ClientlibLink link,
                                 boolean minified)
      • isMinified

        protected boolean isMinified​(String selectors)
      • usefulRequest

        protected boolean usefulRequest​(org.apache.sling.api.SlingHttpServletRequest request,
                                        org.apache.sling.api.SlingHttpServletResponse response)