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 Detail

      • createMetaData

        R2WMetaData createMetaData()
        Create the MetaData for the publishing
        Returns:
        A new meta data object
      • createMetaData

        R2WMetaData createMetaData​(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 file
        is - 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 file
        metaData - 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