Interface R2WPublisher
-
public interface R2WPublisher
An API for creating the zip file and publishing to Report2Web allowing for streaming of the file data directly from an InputStream and allowing easier control of the meta data creation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addFile(String filename, InputStream is)
Add a file (via an InputStream).void
addMetaData(String filename, R2WMetaData metaData)
Add the metadata.void
cancel()
Cancel publishing and clean up resources.R2WMetaData
createMetaData()
Create the MetaData for the publishingR2WMetaData
createMetaData(com.redwood.scheduler.api.model.Job context)
Create the MetaData for the publishingvoid
publish(Logger logger)
Publish the file(s) to Report2Web
-
-
-
Method Detail
-
createMetaData
R2WMetaData createMetaData()
Create the MetaData for the publishing- Returns:
- A new meta data object
-
createMetaData
R2WMetaData createMetaData(com.redwood.scheduler.api.model.Job context)
Create the MetaData for the publishing- Parameters:
context
- the context to generate the meta data from- Returns:
- A new meta data object
-
addFile
void addFile(String filename, InputStream is) throws IOException
Add a file (via an InputStream). Note the InputStream is not closed by this method.- Parameters:
filename
- the name of the fileis
- the input stream for the file- Throws:
IOException
- if writing the file data fails
-
addMetaData
void addMetaData(String filename, R2WMetaData metaData) throws IOException
Add the metadata.- Parameters:
filename
- the name of the metadata filemetaData
- the metadata- Throws:
IOException
- if writing the data fails
-
publish
void publish(Logger logger) throws com.redwood.scheduler.api.exception.R2WPublishException
Publish the file(s) to Report2Web- Parameters:
logger
- the logger- Throws:
com.redwood.scheduler.api.exception.R2WPublishException
- if the publishing fails
-
cancel
void cancel() throws IOException
Cancel publishing and clean up resources.- Throws:
IOException
- if the resources fail to clean up
-
-