|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webmethods.caf.faces.bean.SimpleFileExportBean
public class SimpleFileExportBean
This is a simple implementation of IFileExportBeanEx that is java bean compatible. If created as a bean then exportFileName, exportContentType and either binaryData or textData properties must be set. For textData, exportCharactersEncoding should be set as well.
Field Summary | |
---|---|
protected byte[] |
binaryData
The data to be exported as byte [] |
protected String |
charactersEncoding
Character encoding for export of file content. |
protected int |
contentLength
The length of data. |
protected String |
contentType
The content type, see SimpleFileExportBean.setExportContentType(String) . |
protected String |
fileName
Name of the file to be exported. |
protected boolean |
forceDownload
boolean for force download, see
SimpleFileExportBean.setDownloadForced(boolean) . |
protected boolean |
isBinary
boolean that denotes that the content is binary. |
protected String |
textData
The data to be exported as String |
Fields inherited from interface com.webmethods.caf.faces.bean.IFileExportBean |
---|
UNKNOWN_CONTENT_LENGTH |
Constructor Summary | |
---|---|
SimpleFileExportBean()
Bean empty constructor |
|
SimpleFileExportBean(String fileName,
String contentType,
int contentLength,
boolean forceDownload,
byte[] binaryData)
Constructor. |
|
SimpleFileExportBean(String fileName,
String contentType,
int contentLength,
boolean forceDownload,
String textData)
Constructor. |
Method Summary | |
---|---|
byte[] |
getBinaryData()
Returns the binary data. |
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 |
String |
getTextData()
Returns the text 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 |
setBinaryData(byte[] binaryData)
Sets the binary data for export. |
void |
setDownloadForced(boolean forceDownload)
Sets force download to send the response headers that will force the user to choose what to do with the file (Open vs. |
void |
setExportCharacterEncoding(String encoding)
Sets character encoding for this export file content (valid only when isExportBinary() == false) |
void |
setExportContentType(String contentType)
Sets the content type of the response being sent to the client. |
void |
setExportFileName(String fileName)
Return the file name for the exported data. |
void |
setTextData(String textData)
Sets the text data for export. |
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 |
---|
protected boolean forceDownload
boolean
for force download, see
SimpleFileExportBean.setDownloadForced(boolean)
.
protected String fileName
protected String contentType
SimpleFileExportBean.setExportContentType(String)
.
protected int contentLength
protected boolean isBinary
boolean
that denotes that the content is binary.
protected byte[] binaryData
byte []
protected String textData
String
protected String charactersEncoding
Default: UTF-8
Constructor Detail |
---|
public SimpleFileExportBean()
public SimpleFileExportBean(String fileName, String contentType, int contentLength, boolean forceDownload, byte[] binaryData)
fileName
- name of the file to be exportedcontentType
- the content type, see SimpleFileExportBean.setExportContentType(String)
contentLength
- the length of dataforceDownload
- force download, see SimpleFileExportBean.setDownloadForced(boolean)
binaryData
- the data to be exported as byte []
public SimpleFileExportBean(String fileName, String contentType, int contentLength, boolean forceDownload, String textData)
fileName
- name of the file to be exportedcontentType
- the content type, see SimpleFileExportBean.setExportContentType(String)
contentLength
- the length of dataforceDownload
- force download, see SimpleFileExportBean.setDownloadForced(boolean)
textData
- the data to be exported as String
Method Detail |
---|
public boolean isDownloadForced()
IFileExportBean
isDownloadForced
in interface IFileExportBean
public void setDownloadForced(boolean forceDownload)
forceDownload
- The forceDownload to set.public String getExportFileName()
IFileExportBean
getExportFileName
in interface IFileExportBean
public void setExportFileName(String fileName)
fileName
- name for the filepublic String getExportContentType()
IFileExportBean
getExportContentType
in interface IFileExportBean
public void setExportContentType(String contentType)
The content type may include the type of character encoding used, for example, text/html; charset=ISO-8859-4.
contentType
- public int getExportContentLength()
IFileExportBean
getExportContentLength
in interface IFileExportBean
IFileExportBean.UNKNOWN_CONTENT_LENGTH
if it is not knownpublic boolean isExportBinary()
IFileExportBean
isExportBinary
in interface IFileExportBean
public void writeExportText(PrintWriter writer)
IFileExportBean
writeExportText
in interface IFileExportBean
writer
- the output writerpublic void writeExportBytes(OutputStream outStream) throws IOException
IFileExportBean
writeExportBytes
in interface IFileExportBean
outStream
- the output stream
IOException
- thrown if there is an I/O exception during the exportpublic String getExportCharacterEncoding()
IFileExportBeanEx
getExportCharacterEncoding
in interface IFileExportBeanEx
public void setExportCharacterEncoding(String encoding)
encoding
- Java character encoding namepublic byte[] getBinaryData()
public void setBinaryData(byte[] binaryData)
binaryData
- binary data as byte []
public String getTextData()
public void setTextData(String textData)
textData
- text data as String
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |