Class JcrFileExportBean

java.lang.Object
com.webmethods.caf.jcr.faces.bean.JcrFileExportBean
All Implemented Interfaces:
IFileExportBean, IFileExportBeanEx

public class JcrFileExportBean extends Object implements IFileExportBeanEx
Handles export of a JCR file node content
Since:
8.0
  • Field Details

    • fileNode

      protected javax.jcr.Node fileNode
      Holds the file Node to export
  • Constructor Details

    • JcrFileExportBean

      public JcrFileExportBean(javax.jcr.Node fileNode, boolean forceDownload) throws javax.jcr.RepositoryException
      Constructor
      Parameters:
      fileNode - the JCR fileNode to export
      forceDownload - if true, forces a prompt to the end user to ask if they want to save or open
      Throws:
      javax.jcr.RepositoryException
  • Method Details

    • getExportCharacterEncoding

      public String getExportCharacterEncoding()
      Description copied from interface: IFileExportBeanEx
      Returns character encoding for this export file content (valid only when isExportBinary() == false)
      Specified by:
      getExportCharacterEncoding in interface IFileExportBeanEx
      Returns:
      java character encoding name
    • getExportContentLength

      public int getExportContentLength()
      Description copied from interface: IFileExportBean
      Return the length of the content that is to be exported.
      Specified by:
      getExportContentLength in interface IFileExportBean
      Returns:
      the length of the content or return IFileExportBean.UNKNOWN_CONTENT_LENGTH if it is not known
    • getExportContentType

      public String getExportContentType()
      Description copied from interface: IFileExportBean
      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.
      Specified by:
      getExportContentType in interface IFileExportBean
      Returns:
      content type of the exported content
    • getExportFileName

      public String getExportFileName()
      Description copied from interface: IFileExportBean
      Return the file name for the exported data
      Specified by:
      getExportFileName in interface IFileExportBean
      Returns:
      file name for the exported file
    • isDownloadForced

      public boolean isDownloadForced()
      Description copied from interface: IFileExportBean
      Return true to send the response headers that will force the user to choose what to do with the file (Open vs. Save).
      Specified by:
      isDownloadForced in interface IFileExportBean
      Returns:
      true to force a download
    • isExportBinary

      public boolean isExportBinary()
      Description copied from interface: IFileExportBean
      Return true if the export will be sending binary data to the response, false if the export will be sending text.
      Specified by:
      isExportBinary in interface IFileExportBean
      Returns:
      true for binary export, false for text
    • writeExportBytes

      public void writeExportBytes(OutputStream outStream) throws IOException
      Description copied from interface: IFileExportBean
      Invoked to allow the bean to write binary data to the output stream.
      Specified by:
      writeExportBytes in interface IFileExportBean
      Parameters:
      outStream - the output stream
      Throws:
      IOException - thrown if there is an I/O exception during the export
    • writeExportText

      public void writeExportText(PrintWriter writer)
      Description copied from interface: IFileExportBean
      Invoked to allow the bean to write the export text to the output writer.
      Specified by:
      writeExportText in interface IFileExportBean
      Parameters:
      writer - the output writer