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 ClientlibConfigurationconfigurationprotected static PatternHASHSUFFIX_PATTERNstatic StringPATHThe path at which this servlet is deployed.protected ClientlibServiceservice
-
Constructor Summary
Constructors Constructor Description ClientlibCategoryServlet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoGet(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull org.apache.sling.api.SlingHttpServletResponse response)protected voiddoHead(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull org.apache.sling.api.SlingHttpServletResponse response)protected @NotNull ClientlibServicegetClientlibService()protected ClientlibConfiguration.ConfiggetConfig()static StringmakePath(String category, Clientlib.Type type, boolean minified, String hash)Creates an path that is rendered by this servlet containing the given parameters.protected StringmakeUri(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:
getClientlibServicein classAbstractClientlibServlet
-
getConfig
@NotNull protected ClientlibConfiguration.Config getConfig()
- Specified by:
getConfigin 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:
makeUriin 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:
doGetin classorg.apache.sling.api.servlets.SlingSafeMethodsServlet- Throws:
javax.servlet.ServletExceptionIOException
-
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:
doHeadin classorg.apache.sling.api.servlets.SlingSafeMethodsServlet- Throws:
javax.servlet.ServletExceptionIOException
-
-