Package com.webmethods.caf.faces.bean
Class URLContentExportBean
java.lang.Object
com.webmethods.caf.faces.bean.URLContentExportBean
- All Implemented Interfaces:
IFileExportBean
,IFileExportBeanEx
- Direct Known Subclasses:
FileContentExportBean
Export the Contents of a URL
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
Character encoding for export of file content.protected URLConnection
URLConnection
to the URL resource to be exportedprotected boolean
boolean
for force download, see#setDownloadForced(boolean)
.Fields inherited from interface com.webmethods.caf.faces.bean.IFileExportBean
UNKNOWN_CONTENT_LENGTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns character encoding for this export file content (valid only when isExportBinary() == false)int
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
setExportCharacterEncoding
(String charactersEncoding) Sets character encoding for this export file content (valid only when isExportBinary() == false)void
writeExportBytes
(OutputStream outStream) Invoked to allow the bean to write binary data to the output stream.void
writeExportText
(PrintWriter arg0) Invoked to allow the bean to write the export text to the output writer.
-
Field Details
-
connection
URLConnection
to the URL resource to be exported -
forceDownload
protected boolean forceDownloadboolean
for force download, see#setDownloadForced(boolean)
. -
charactersEncoding
Character encoding for export of file content.Default: UTF-8
-
-
Constructor Details
-
URLContentExportBean
Constructor.- Parameters:
url
- URL to the resource to be exportedforceDownload
- force download, seeisDownloadForced()
- Throws:
IOException
- when exceptions in opening a connection to the passed URL
-
-
Method Details
-
getExportContentLength
public int getExportContentLength()Description copied from interface:IFileExportBean
Return the length of the content that is to be exported.- Specified by:
getExportContentLength
in interfaceIFileExportBean
- Returns:
- the length of the content or return
IFileExportBean.UNKNOWN_CONTENT_LENGTH
if it is not known
-
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 interfaceIFileExportBean
- Returns:
- content type of the exported content
-
getExportFileName
Description copied from interface:IFileExportBean
Return the file name for the exported data- Specified by:
getExportFileName
in interfaceIFileExportBean
- 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 interfaceIFileExportBean
- 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 interfaceIFileExportBean
- Returns:
- true for binary export, false for text
-
writeExportBytes
Description copied from interface:IFileExportBean
Invoked to allow the bean to write binary data to the output stream.- Specified by:
writeExportBytes
in interfaceIFileExportBean
- Parameters:
outStream
- the output stream- Throws:
IOException
- thrown if there is an I/O exception during the export
-
writeExportText
Description copied from interface:IFileExportBean
Invoked to allow the bean to write the export text to the output writer.- Specified by:
writeExportText
in interfaceIFileExportBean
- Parameters:
arg0
- the output writer
-
getExportCharacterEncoding
Description copied from interface:IFileExportBeanEx
Returns character encoding for this export file content (valid only when isExportBinary() == false)- Specified by:
getExportCharacterEncoding
in interfaceIFileExportBeanEx
- Returns:
- java character encoding name
-
setExportCharacterEncoding
Sets character encoding for this export file content (valid only when isExportBinary() == false)- Parameters:
charactersEncoding
- Java character encoding name
-