Class AbstractClientlibServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- org.apache.sling.api.servlets.SlingSafeMethodsServlet
-
- com.composum.sling.clientlibs.servlet.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 Summary
Constructors Constructor Description AbstractClientlibServlet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
deliverClientlib(boolean get, org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response, ClientlibRef clientlibRef, String requestedHash, boolean minified)
protected abstract @NotNull ClientlibService
getClientlibService()
protected abstract ClientlibConfiguration.Config
getConfig()
protected boolean
isMinified(String selectors)
protected abstract String
makeUri(boolean minified, ClientlibLink link)
protected String
makeUrl(org.apache.sling.api.SlingHttpServletRequest request, ClientlibLink link, boolean minified)
protected boolean
usefulRequest(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response)
-
Methods inherited from class org.apache.sling.api.servlets.SlingSafeMethodsServlet
doGeneric, doGet, doHead, doOptions, doTrace, getAllowedRequestMethods, getServletInfo, handleMethodNotImplemented, mayService, service, service
-
-
-
-
Method Detail
-
getClientlibService
@NotNull protected abstract @NotNull ClientlibService getClientlibService()
-
getConfig
@NotNull protected abstract ClientlibConfiguration.Config getConfig()
-
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 requestrequestedHash
- 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)
-
makeUri
protected abstract String makeUri(boolean minified, ClientlibLink link)
-
isMinified
protected boolean isMinified(String selectors)
-
usefulRequest
protected boolean usefulRequest(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response)
-
-