Class WritableResource

    • Constructor Detail

      • WritableResource

        protected WritableResource​(String filename)
        Constructor.
        Parameters:
        filename - resource file name
      • WritableResource

        protected WritableResource​(String filename,
                                   String mimeType)
        Convenience constructor that also sets the MIME type.
        Parameters:
        filename - resource file name
        mimeType - resource MIME type
    • Method Detail

      • writeTo

        public abstract void writeTo​(OutputStream output)
                              throws IOException
        Write the resource contents to the given OutputStream and then close it.

        Note that the VaadinSession associated with this resource will not be locked when this method is invoked.

        Specified by:
        writeTo in interface WriteCallback
        Parameters:
        output - resource output stream
        Throws:
        IOException - if an I/O error occurs