|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.report.targets.table.html.ZIPHtmlFilesystem
Similiar to the DirectoryHtmlFilesystem, the generated Html-File and the supplementary data files (images and external Stylesheet definition) into a directory in a ZIP-File. The data files can be written into a separated data directory within the ZIP-File.
External referenced content can either be copied into the data directory or could
be included as linked content. This behaviour is controled by the copyExternalImages
flag.
Constructor Summary | |
ZIPHtmlFilesystem(java.io.OutputStream out,
java.lang.String dataDirectory)
Creates a new ZIPHtmlFilesystem. |
Method Summary | |
void |
close()
Close the Filesystem and write any buffered content. |
HtmlReferenceData |
createCSSReference(java.lang.String styleSheet)
Creates a HtmlReference for StyleSheetData. |
HtmlReferenceData |
createImageReference(ImageReference reference)
Creates a HtmlReference for ImageData. |
java.io.OutputStream |
getRootStream()
The root stream is used to write the main HTML-File. |
boolean |
isCopyExternalImages()
Returns true, if external content should be copied into the DataDirectory of the ZIPFile or false if the content should be included as linked content. |
protected boolean |
isSupportedImageFormat(java.net.URL url)
Tests, whether the given URL points to a supported file format for common browsers. |
void |
setCopyExternalImages(boolean copyExternalImages)
Defines, whether external content should be copied into the DataDirectory of the ZIPFile or should be included as linked content. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ZIPHtmlFilesystem(java.io.OutputStream out, java.lang.String dataDirectory) throws java.io.IOException
out
- the target output stream.dataDirectory
- the data directory, relative within the ZIP file.
java.io.IOException
- if an IO error occurs.Method Detail |
public java.io.OutputStream getRootStream() throws java.io.IOException
getRootStream
in interface HtmlFilesystem
java.io.IOException
- if an IO error occured, while providing the root stream.public boolean isCopyExternalImages()
Linked content reduces the filesize, but the reader of the report will need access to the linked files. If you pan to use the report offline, then it is best to copy all referenced data into the zip file.
public void setCopyExternalImages(boolean copyExternalImages)
Linked content reduces the filesize, but the reader of the report will need access to the linked files. If you pan to use the report offline, then it is best to copy all referenced data into the zip file.
copyExternalImages
- true, if external referenced content should be copied into the ZIP
file, false otherwise.protected boolean isSupportedImageFormat(java.net.URL url)
The checked filetypes are the ones recommended by the W3C.
url
- the url that should be tested.
public HtmlReferenceData createImageReference(ImageReference reference) throws java.io.IOException
If the image was generated during the report processing or is not in a commonly supported format, then the image is recoded as PNG and the recoded image is included in the data directory.
If external referenced data should be copied into the data directory, then the Image content is read and copied into the data directory.
createImageReference
in interface HtmlFilesystem
reference
- the image reference containing the data.
java.io.IOException
- if IO errors occured while creating the reference.isSupportedImageFormat(java.net.URL)
public HtmlReferenceData createCSSReference(java.lang.String styleSheet) throws java.io.IOException
createCSSReference
in interface HtmlFilesystem
styleSheet
- the stylesheet data, which should be referenced.
java.io.IOException
- if IO errors occured while creating the reference.public void close() throws java.io.IOException
close
in interface HtmlFilesystem
java.io.IOException
- if the close operation failed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |