Class ExportOutputStream

  • All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable
    Direct Known Subclasses:
    FileExportOutputStream, ServletExportOutputStream

    public class ExportOutputStream
    extends OutputStream
    An output stream used for immediate download from export plugins. The plugin must implement the ImmediateDownloadExporter interface. If the plugin wants to set mime type, character set, content length and filename it must do so before it starts writing data to the output stream.

    This class is intended to be subclassed by implementations more suitable for the type of download. For example the ServletExportOutputStream implements direct download from web clients and the FileExportOutputStream implements direct download to the BASE file system.

    Version:
    2.2
    Author:
    nicklas
    Last modified
    $Date: 2009-02-25 10:55:44 +0100 (on, 25 feb 2009) $
    • Constructor Detail

      • ExportOutputStream

        public ExportOutputStream​(OutputStream out)
        Create a new export stream.
        Parameters:
        out - The underlying stream to write the exported data to
        Throws:
        NullPointerException - If out is null
    • Method Detail

      • setContentLength

        public void setContentLength​(long contentLength)
        Do nothing. Should be overridden by subclasses.
      • setMimeType

        public void setMimeType​(String mimeType)
        Do nothing. Should be overridden by subclasses.
      • setCharacterSet

        public void setCharacterSet​(String charset)
        Do nothing should be overridden by subclasses.
        Since:
        2.9
      • setFilename

        public void setFilename​(String name)
        Do nothing. Should be overridden by subclasses.
      • getFile

        public File getFile()
        If the export stream is going to a BASE File object, use this method to access it. This class always return null, subclasses may override this method.
        Returns:
        A File object or null
        Since:
        2.11