public class URLContentExportBean extends Object implements IFileExportBeanEx
Modifier and Type | Field and Description |
---|---|
protected String |
charactersEncoding
Character encoding for export of file content.
|
protected URLConnection |
connection
URLConnection to the URL resource to be exported |
protected boolean |
forceDownload
boolean for force download, see
#setDownloadForced(boolean) . |
UNKNOWN_CONTENT_LENGTH
Constructor and Description |
---|
URLContentExportBean(URL url,
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 |
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.
|
protected URLConnection connection
URLConnection
to the URL resource to be exportedprotected boolean forceDownload
boolean
for force download, see
#setDownloadForced(boolean)
.protected String charactersEncoding
Default: UTF-8
public URLContentExportBean(URL url, boolean forceDownload) throws IOException
url
- URL to the resource to be exportedforceDownload
- force download, see isDownloadForced()
IOException
- when exceptions in opening a connection to the passed URLpublic 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 arg0)
IFileExportBean
writeExportText
in interface IFileExportBean
arg0
- the output writerpublic String getExportCharacterEncoding()
IFileExportBeanEx
getExportCharacterEncoding
in interface IFileExportBeanEx
public void setExportCharacterEncoding(String charactersEncoding)
charactersEncoding
- Java character encoding name