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 Stringfilename(String mediaType, int count)A convenience method to return a suggested filename for a particular resourcestatic HtmlDerivation.ResourceManagernewFileResourceManager(Path root, Path relativeTo)A ResourceManager which stores resources on the filesystemStringstore(String mediaType, 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
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 datadata- 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 mediaTypecount- a number to embed into the filename, eg 2 to get "image-00002.png"
-
newFileResourceManager
static HtmlDerivation.ResourceManager newFileResourceManager(Path root, Path relativeTo) throws 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:
IllegalArgumentException
-
-