Class DefaultWidgetLibUtils.DefaultModuleContentProvider

    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultModuleContentProvider​(java.lang.String moduleName, java.lang.String definitionXmlContent, java.io.ByteArrayOutputStream baos)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void finalizeStream​(java.io.OutputStream destination)
      Finalizes a module library.
      java.io.OutputStream prepareStream​(java.io.OutputStream destination)
      Prepares a destination stream for library contents.
      void writeContent​(java.io.OutputStream destination)
      Sends all library content to provided output stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultModuleContentProvider

        public DefaultModuleContentProvider​(java.lang.String moduleName,
                                            java.lang.String definitionXmlContent,
                                            java.io.ByteArrayOutputStream baos)
    • Method Detail

      • prepareStream

        public java.io.OutputStream prepareStream​(java.io.OutputStream destination)
                                           throws java.io.IOException
        Description copied from interface: ModuleContentProvider
        Prepares a destination stream for library contents.

        Whatever logic is implemented in scope of this method, a returned stream should not prevent from writing content into provided stream.

        Specified by:
        prepareStream in interface ModuleContentProvider
        Parameters:
        destination - destination stream compatible with library handler
        Returns:
        actual destination stream to be used by library handler
        Throws:
        java.io.IOException - whenever there is a problem with initializing library destination stream
      • writeContent

        public void writeContent​(java.io.OutputStream destination)
                          throws java.io.IOException
        Description copied from interface: ModuleContentProvider
        Sends all library content to provided output stream.
        Specified by:
        writeContent in interface ModuleContentProvider
        Parameters:
        destination - library output stream
        Throws:
        java.io.IOException - whenever there is a problem with providing library contents
      • finalizeStream

        public void finalizeStream​(java.io.OutputStream destination)
        Description copied from interface: ModuleContentProvider
        Finalizes a module library.

        Method is called once per module library just before a stream is closed.

        Specified by:
        finalizeStream in interface ModuleContentProvider
        Parameters:
        destination - module library stream