com.webmethods.caf.jcr.faces.bean
Class JcrFileVersionExportBean

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

public class JcrFileVersionExportBean
extends Object
implements IFileExportBeanEx

Handles the export of a version of a jcr file.

Since:
8.0

Field Summary
protected  Node fileNode
          Holds the file Node to export
 
Fields inherited from interface com.webmethods.caf.faces.bean.IFileExportBean
UNKNOWN_CONTENT_LENGTH
 
Constructor Summary
JcrFileVersionExportBean(Node fileNode, boolean forceDownload)
          Constructor
 
Method Summary
 String getExportCharacterEncoding()
          Returns character encoding for this export file content (valid only when isExportBinary() == false)
 int getExportContentLength()
          Return the length of the content that is to be exported.
 String getExportContentType()
          Gets the content type of the response being sent to the client.
 String getExportFileName()
          Return the file name for the exported data
 boolean isDownloadForced()
          Return true to send the response headers that will force the user to choose what to do with the file (Open vs.
 boolean isExportBinary()
          Return true if the export will be sending binary data to the response, false if the export will be sending text.
 void writeExportBytes(OutputStream outStream)
          Invoked to allow the bean to write binary data to the output stream.
 void writeExportText(PrintWriter writer)
          Invoked to allow the bean to write the export text to the output writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileNode

protected Node fileNode
Holds the file Node to export

Constructor Detail

JcrFileVersionExportBean

public JcrFileVersionExportBean(Node fileNode,
                                boolean forceDownload)
                         throws RepositoryException
Constructor

Parameters:
fileNode - the JCR version node to export
forceDownload - if true, forces a prompt to the end user to ask if they want to save or open
Throws:
RepositoryException
Method Detail

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