Interface ResourceHandler

    • Method Detail

      • setup

        Source setup​(String source,
                     Map objectModel,
                     Parameters par,
                     boolean readForDownload)
              throws IOException,
                     ProcessingException
        Initialize the resource handler with a resource.
        Parameters:
        source - The source uri
        objectModel - The object model
        par - The parameters
        readForDownload - if the resource is to be downloaded and not rendered.
        Returns:
        the resolved source
        Throws:
        IOException - If an error occurs
        ProcessingException - If an error occurs
      • getKey

        Serializable getKey()
        Get the unique key for this resource, for cache purpose.
        Returns:
        The cache key.
      • getLength

        long getLength()
        Get the resource size, if available.
        Returns:
        The resource size.
      • getLastModified

        long getLastModified()
        Get the resource last modified time
        Returns:
        The last modified
      • getMimeType

        String getMimeType()
        Return the mime type of the configured resource.
        Returns:
        The mime type.
      • shouldUseSourceContentLength

        default boolean shouldUseSourceContentLength()
        Returns true if the response Content-Length header should be set according to the source's length (ie. the source is not transformed during processing).
        Returns:
        true if the source's length can be relied on