Interface HtmlDerivation.ResourceManager

  • Enclosing class:
    HtmlDerivation

    public static interface HtmlDerivation.ResourceManager
    An interface used to manage external resources (eg images) that are referenced from the HTML
    Since:
    2.29.5
    • Field Detail

      • INLINE

        static final HtmlDerivation.ResourceManager INLINE
        A ResourceManager which stores resources as "data" urls for direct embedding into the HTML
    • Method Detail

      • store

        String store​(String mediaType,
                     InputStream data)
              throws IOException
        Store the specified external resource and return a URL where it could be accessed by the HTML being generated
        Parameters:
        mediaType - the media-type of the data
        data - the data itself
        Returns:
        a URI to embed in the generated HTML to access the data
        Throws:
        IOException
      • filename

        static String filename​(String mediaType,
                               int count)
        A convenience method to return a suggested filename for a particular resource
        Parameters:
        mediaType - the mediaType
        count - a number to embed into the filename, eg 2 to get "image-00002.png"