Interface IFileExportBean

All Known Subinterfaces:
IFileExportBeanEx
All Known Implementing Classes:
AtomExportBean, CSVExportBean, FileContentExportBean, JcrFileExportBean, JcrFileVersionExportBean, SimpleFileExportBean, URLContentExportBean

public interface IFileExportBean
Action Handlers that wish to export a file to the user can pass an instance of this interface to the BaseViewBean.streamFileDataToResponse(IFileExportBean) API.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Use this constant for the export content length when the length is not known
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Return the length of the content that is to be exported.
    Gets the content type of the response being sent to the client.
    Return the file name for the exported data
    boolean
    Return true to send the response headers that will force the user to choose what to do with the file (Open vs.
    boolean
    Return true if the export will be sending binary data to the response, false if the export will be sending text.
    void
    Invoked to allow the bean to write binary data to the output stream.
    void
    Invoked to allow the bean to write the export text to the output writer.
  • Field Details

    • UNKNOWN_CONTENT_LENGTH

      static final int UNKNOWN_CONTENT_LENGTH
      Use this constant for the export content length when the length is not known
      See Also:
  • Method Details

    • isDownloadForced

      boolean isDownloadForced()
      Return true to send the response headers that will force the user to choose what to do with the file (Open vs. Save).
      Returns:
      true to force a download
    • getExportFileName

      String getExportFileName()
      Return the file name for the exported data
      Returns:
      file name for the exported file
    • getExportContentType

      String getExportContentType()
      Gets the content type of the response being sent to the client. The content type may include the type of character encoding used, for example, text/html; charset=ISO-8859-4.
      Returns:
      content type of the exported content
    • getExportContentLength

      int getExportContentLength()
      Return the length of the content that is to be exported.
      Returns:
      the length of the content or return UNKNOWN_CONTENT_LENGTH if it is not known
    • isExportBinary

      boolean isExportBinary()
      Return true if the export will be sending binary data to the response, false if the export will be sending text.
      Returns:
      true for binary export, false for text
    • writeExportText

      void writeExportText(PrintWriter writer)
      Invoked to allow the bean to write the export text to the output writer.
      Parameters:
      writer - the output writer
    • writeExportBytes

      void writeExportBytes(OutputStream outStream) throws IOException
      Invoked to allow the bean to write binary data to the output stream.
      Parameters:
      outStream - the output stream
      Throws:
      IOException - thrown if there is an I/O exception during the export