Class ClientlibServlet

    • Constructor Detail

      • ClientlibServlet

        public ClientlibServlet()
    • Method Detail

      • 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 class org.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 class org.apache.sling.api.servlets.SlingSafeMethodsServlet
        Throws:
        javax.servlet.ServletException
        IOException
      • makePath

        public 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.
      • appendHashSuffix

        public 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.