public class ServletExportOutputStream extends ExportOutputStream
ExportOutputStream
class which
directs the output to the response stream of a
HttpServletResponse
object. This allows an export plugin
to send data directly to the web browser without going throgh
the BASE filesystem or temporary files on the disk.Modifier and Type | Field and Description |
---|---|
private HttpServletResponse |
response |
Constructor and Description |
---|
ServletExportOutputStream(HttpServletResponse response)
Create a new servlet export stream.
|
Modifier and Type | Method and Description |
---|---|
void |
setCharacterSet(String charset)
|
void |
setContentLength(long contentLength)
|
void |
setFilename(String filename)
Calls
HttpServletResponse.setHeader(java.lang.String, java.lang.String)
with the following values:
response.setHeader("Content-Disposition", "attachment;filename=<filename>");
If the filename contains unsafe characters it is URL encoded. |
void |
setMimeType(String mimeType)
|
private final HttpServletResponse response
public ServletExportOutputStream(HttpServletResponse response) throws IOException
response
- The servlet response objectIOException
- If getting the output stream from the reponse fails.public void setContentLength(long contentLength)
setContentLength
in class ExportOutputStream
public void setMimeType(String mimeType)
setMimeType
in class ExportOutputStream
public void setCharacterSet(String charset)
setCharacterSet
in class ExportOutputStream
public void setFilename(String filename)
HttpServletResponse.setHeader(java.lang.String, java.lang.String)
with the following values:
response.setHeader("Content-Disposition", "attachment;filename=<filename>");
If the filename contains unsafe characters it is URL encoded.setFilename
in class ExportOutputStream