Interface HtmlLibrary


  • @ProviderType
    public interface HtmlLibrary
    HtmlLibrary represents a JS or CSS library that is assembled dynamically be a bunch of files.
    • Method Detail

      • getPath

        java.lang.String getPath()
        Returns the include path of this library. eg: "/libs/cq/ui/widgets.js"
        Returns:
        the include path.
      • getPath

        java.lang.String getPath​(boolean minified)
        Returns the include path of this library. eg: "/libs/cq/ui/widgets.js"
        Parameters:
        minified - true to return the path to the minified version. e.g. "/libs/cq/ui/widgets.min.js"
        Returns:
        the include path.
        Since:
        5.5.30
      • getLibraryPath

        java.lang.String getLibraryPath()
        Returns the library path of this library. eg: "/libs/cq/ui/widgets"
        Returns:
        the library path
      • getName

        java.lang.String getName()
        Returns the (final) name of this library. eg: "widgets.js"
        Returns:
        the library name
      • getName

        java.lang.String getName​(boolean minified)
        Returns the (final) name of this library. eg: "widgets.js"
        Parameters:
        minified - true to return the minified name. eg "widgets.min.js"
        Returns:
        the library name
        Since:
        5.5.30
      • getType

        LibraryType getType()
        Returns the library type
        Returns:
        the library type
      • getLastModified

        long getLastModified()
        Returns the lastModified date of this library
        Returns:
        last modified date as long
      • getLastModified

        long getLastModified​(boolean minified)
        Returns the lastModified date of this library
        Parameters:
        minified - true to return the last modified date of the minified version
        Returns:
        last modified date as long
        Since:
        5.5.30
      • send

        void send​(SlingHttpServletRequest request,
                  SlingHttpServletResponse response)
           throws java.io.IOException
        send the input stream of the generated lib to the response. Handles "if-modified-since", sets the response content type and encoding headers and cache-control header as configured in the html library manager.
        Parameters:
        request - servlet request
        response - servlet response
        Throws:
        java.io.IOException - is thrown in case the copy operation fails
        Since:
        5.5.30
      • getInputStream

        java.io.InputStream getInputStream()
                                    throws java.io.IOException
        Returns the input stream of the generated lib file
        Returns:
        input stream
        Throws:
        java.io.IOException - if the stream cannot be acquired
      • getInputStream

        java.io.InputStream getInputStream​(boolean minified)
                                    throws java.io.IOException
        Returns the input stream of the generated lib file
        Parameters:
        minified - true to return the stream to the minified version
        Returns:
        input stream
        Throws:
        java.io.IOException - if the stream cannot be acquired
        Since:
        5.5.30
      • getScripts

        java.util.List<java.lang.String> getScripts()
        Returns a list of all script paths.
        Returns:
        list of files
      • getScripts

        java.lang.String getScripts​(java.lang.String delimiter)
        Returns a list of absolute paths to the scripts as a delimiter separated list.
        Parameters:
        delimiter - the delimiter
        Returns:
        the list of scripts