Class ClientlibServlet
- java.lang.Object
- 
- javax.servlet.GenericServlet
- 
- org.apache.sling.api.servlets.SlingSafeMethodsServlet
- 
- com.composum.sling.clientlibs.servlet.AbstractClientlibServlet
- 
- com.composum.sling.clientlibs.servlet.ClientlibServlet
 
 
 
 
- 
- All Implemented Interfaces:
- Serializable,- javax.servlet.Servlet,- javax.servlet.ServletConfig
 
 public class ClientlibServlet extends AbstractClientlibServlet - See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected ClientlibConfigurationconfigurationprotected static PatternFILENAME_PATTERNprotected static PatternHASHSUFFIX_PATTERNprotected ClientlibServiceservice
 - 
Constructor SummaryConstructors Constructor Description ClientlibServlet()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringappendHashSuffix(String url, String hash)Appends a suffix containing the hash code, if given.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 path, 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 StringparseHashFromSuffix(String suffix)Does the inverse toappendHashSuffix(String, String): extracts the hash from the generated suffix.- 
Methods inherited from class com.composum.sling.clientlibs.servlet.AbstractClientlibServletdeliverClientlib, isMinified, makeUrl, usefulRequest
 - 
Methods inherited from class org.apache.sling.api.servlets.SlingSafeMethodsServletdoGeneric, doOptions, doTrace, getAllowedRequestMethods, getServletInfo, handleMethodNotImplemented, mayService, service, service
 
- 
 
- 
- 
- 
Field Detail- 
FILENAME_PATTERNprotected static final Pattern FILENAME_PATTERN 
 - 
HASHSUFFIX_PATTERNprotected static final Pattern HASHSUFFIX_PATTERN 
 - 
serviceprotected ClientlibService service 
 - 
configurationprotected ClientlibConfiguration configuration 
 
- 
 - 
Method Detail- 
getClientlibService@NotNull protected @NotNull ClientlibService getClientlibService() - Specified by:
- getClientlibServicein class- AbstractClientlibServlet
 
 - 
getConfig@NotNull protected ClientlibConfiguration.Config getConfig() - Specified by:
- getConfigin class- AbstractClientlibServlet
 
 - 
doGetprotected 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 class- org.apache.sling.api.servlets.SlingSafeMethodsServlet
- Throws:
- javax.servlet.ServletException
- IOException
 
 - 
doHeadprotected 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 class- org.apache.sling.api.servlets.SlingSafeMethodsServlet
- Throws:
- javax.servlet.ServletException
- IOException
 
 - 
makePathpublic static String makePath(String path, Clientlib.Type type, boolean minified, String hash) Creates an path that is rendered by this servlet containing the given parameters.
 - 
makeUriprotected String makeUri(boolean minified, ClientlibLink link) - Specified by:
- makeUriin class- AbstractClientlibServlet
 
 - 
appendHashSuffixpublic static String appendHashSuffix(String url, String hash) Appends a suffix containing the hash code, if given. The file name is repeated to satisfy browsers with the correct type and file name, though it is not used by the servlet.- Parameters:
- url- an url to which we append the suffix
- hash- optional, the hash code
- Returns:
- the url with suffix /{hash}/{filename} appended, where {filename} is the last part of a / separated url.
 
 - 
parseHashFromSuffixpublic static String parseHashFromSuffix(String suffix) Does the inverse toappendHashSuffix(String, String): extracts the hash from the generated suffix.- Parameters:
- suffix- the suffix generated by- appendHashSuffix(String, String), nullable
- Returns:
- the hash if it could be extracted, otherwise null.
 
 
- 
 
-