Class ClientlibCategoryServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- org.apache.sling.api.servlets.SlingSafeMethodsServlet
-
- com.composum.sling.clientlibs.servlet.AbstractClientlibServlet
-
- com.composum.sling.clientlibs.servlet.ClientlibCategoryServlet
-
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public class ClientlibCategoryServlet extends AbstractClientlibServlet
Serves the clientlibs of a whole category with all embedded stuff. The path /bin/cpm/clientlib.{type}/{hash}/{categoryname}.{type} needs the type as extension and the hash, category and type as suffix.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ClientlibConfiguration
configuration
protected static Pattern
HASHSUFFIX_PATTERN
static String
PATH
The path at which this servlet is deployed.protected ClientlibService
service
-
Constructor Summary
Constructors Constructor Description ClientlibCategoryServlet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doGet(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull org.apache.sling.api.SlingHttpServletResponse response)
protected void
doHead(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull org.apache.sling.api.SlingHttpServletResponse response)
protected @NotNull ClientlibService
getClientlibService()
protected ClientlibConfiguration.Config
getConfig()
static String
makePath(String category, Clientlib.Type type, boolean minified, String hash)
Creates an path that is rendered by this servlet containing the given parameters.protected String
makeUri(boolean minified, ClientlibLink link)
static org.apache.commons.lang3.tuple.Pair<String,String>
parseCategoryAndHashFromSuffix(String suffix)
-
Methods inherited from class com.composum.sling.clientlibs.servlet.AbstractClientlibServlet
deliverClientlib, isMinified, makeUrl, usefulRequest
-
Methods inherited from class org.apache.sling.api.servlets.SlingSafeMethodsServlet
doGeneric, doOptions, doTrace, getAllowedRequestMethods, getServletInfo, handleMethodNotImplemented, mayService, service, service
-
-
-
-
Field Detail
-
service
protected ClientlibService service
-
configuration
protected ClientlibConfiguration configuration
-
PATH
public static final String PATH
The path at which this servlet is deployed.- See Also:
- Constant Field Values
-
HASHSUFFIX_PATTERN
protected static final Pattern HASHSUFFIX_PATTERN
-
-
Method Detail
-
getClientlibService
@NotNull protected @NotNull ClientlibService getClientlibService()
- Specified by:
getClientlibService
in classAbstractClientlibServlet
-
getConfig
@NotNull protected ClientlibConfiguration.Config getConfig()
- Specified by:
getConfig
in classAbstractClientlibServlet
-
makePath
public static String makePath(String category, Clientlib.Type type, boolean minified, String hash)
Creates an path that is rendered by this servlet containing the given parameters.
-
makeUri
protected String makeUri(boolean minified, ClientlibLink link)
- Specified by:
makeUri
in classAbstractClientlibServlet
-
doGet
protected void doGet(@NotNull @NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull @NotNull org.apache.sling.api.SlingHttpServletResponse response) throws javax.servlet.ServletException, IOException
- Overrides:
doGet
in classorg.apache.sling.api.servlets.SlingSafeMethodsServlet
- Throws:
javax.servlet.ServletException
IOException
-
doHead
protected void doHead(@NotNull @NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull @NotNull org.apache.sling.api.SlingHttpServletResponse response) throws javax.servlet.ServletException, IOException
- Overrides:
doHead
in classorg.apache.sling.api.servlets.SlingSafeMethodsServlet
- Throws:
javax.servlet.ServletException
IOException
-
-