public class JcrFileExportBean extends Object implements IFileExportBeanEx
Modifier and Type | Field and Description |
---|---|
protected javax.jcr.Node |
fileNode
Holds the file Node to export
|
UNKNOWN_CONTENT_LENGTH
Constructor and Description |
---|
JcrFileExportBean(javax.jcr.Node fileNode,
boolean forceDownload)
Constructor
|
Modifier and Type | Method and Description |
---|---|
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.
|
public JcrFileExportBean(javax.jcr.Node fileNode, boolean forceDownload) throws javax.jcr.RepositoryException
fileNode
- the JCR fileNode to exportforceDownload
- if true, forces a prompt to the end user to ask if they want to save or openjavax.jcr.RepositoryException
public String getExportCharacterEncoding()
IFileExportBeanEx
getExportCharacterEncoding
in interface IFileExportBeanEx
public int getExportContentLength()
IFileExportBean
getExportContentLength
in interface IFileExportBean
IFileExportBean.UNKNOWN_CONTENT_LENGTH
if it is not knownpublic String getExportContentType()
IFileExportBean
getExportContentType
in interface IFileExportBean
public String getExportFileName()
IFileExportBean
getExportFileName
in interface IFileExportBean
public boolean isDownloadForced()
IFileExportBean
isDownloadForced
in interface IFileExportBean
public boolean isExportBinary()
IFileExportBean
isExportBinary
in interface IFileExportBean
public void writeExportBytes(OutputStream outStream) throws IOException
IFileExportBean
writeExportBytes
in interface IFileExportBean
outStream
- the output streamIOException
- thrown if there is an I/O exception during the exportpublic void writeExportText(PrintWriter writer)
IFileExportBean
writeExportText
in interface IFileExportBean
writer
- the output writer