Package com.webmethods.caf.faces.bean
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
FieldsModifier and TypeFieldDescriptionstatic final int
Use this constant for the export content length when the length is not known -
Method Summary
Modifier and TypeMethodDescriptionint
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 databoolean
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
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.
-
Field Details
-
UNKNOWN_CONTENT_LENGTH
static final int UNKNOWN_CONTENT_LENGTHUse 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
Invoked to allow the bean to write the export text to the output writer.- Parameters:
writer
- the output writer
-
writeExportBytes
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
-