Package org.faceless.pdf2
Interface HtmlDerivation.ResourceManager
-
- Enclosing class:
- HtmlDerivation
public static interface HtmlDerivation.ResourceManagerAn interface used to manage external resources (eg images) that are referenced from the HTML- Since:
- 2.29.5
-
-
Field Summary
Fields Modifier and Type Field Description static HtmlDerivation.ResourceManagerINLINEA ResourceManager which stores resources as "data" urls for direct embedding into the HTML
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static java.lang.Stringfilename(java.lang.String mediaType, int count)A convenience method to return a suggested filename for a particular resourcestatic HtmlDerivation.ResourceManagernewFileResourceManager(java.nio.file.Path root, java.nio.file.Path relativeTo)A ResourceManager which stores resources on the filesystemjava.lang.Stringstore(java.lang.String mediaType, java.io.InputStream data)Store the specified external resource and return a URL where it could be accessed by the HTML being generated
-
-
-
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
java.lang.String store(java.lang.String mediaType, java.io.InputStream data) throws java.io.IOExceptionStore 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 datadata- the data itself- Returns:
- a URI to embed in the generated HTML to access the data
- Throws:
java.io.IOException
-
filename
static java.lang.String filename(java.lang.String mediaType, int count)A convenience method to return a suggested filename for a particular resource- Parameters:
mediaType- the mediaTypecount- a number to embed into the filename, eg 2 to get "image-00002.png"
-
newFileResourceManager
static HtmlDerivation.ResourceManager newFileResourceManager(java.nio.file.Path root, java.nio.file.Path relativeTo) throws java.lang.IllegalArgumentException
A ResourceManager which stores resources on the filesystem- Parameters:
root- the path to store the filesrelativeTo- if not null, any returned URLs will be relative URLs relative to this path.- Throws:
java.lang.IllegalArgumentException
-
-