public class SendStreamResponse extends Object implements CommandResponse
Modifier and Type | Field and Description |
---|---|
protected String |
contentDisposition |
protected int |
contentLength |
protected String |
contentType |
protected int |
errorCode |
protected InputStream |
is |
protected boolean |
resetHeaders |
Constructor and Description |
---|
SendStreamResponse(File f)
Send a file as response.
|
SendStreamResponse(File f,
boolean resetHeaders)
Send a file as response.
|
SendStreamResponse(InputStream is,
String contentDisposition)
Send a stream as response, resetting response header
|
SendStreamResponse(InputStream is,
String contentDisposition,
boolean resetHeaders)
Send a stream as response.
|
SendStreamResponse(InputStream is,
String contentDisposition,
int contentLength)
Send a stream as response, resetting response header
|
Modifier and Type | Method and Description |
---|---|
boolean |
execute(CommandRequest cmdReq)
Executes the response.
|
String |
getContentType() |
protected void |
init(InputStream is,
String contentDisposition) |
void |
setContentType(String contentType) |
protected InputStream is
protected String contentDisposition
protected int errorCode
protected boolean resetHeaders
protected String contentType
protected int contentLength
public SendStreamResponse(InputStream is, String contentDisposition)
is
- Stream to sendcontentDisposition
- Should be something like "inline; filename=file.xxx;"public SendStreamResponse(InputStream is, String contentDisposition, int contentLength)
is
- Stream to sendcontentDisposition
- Should be something like "inline; filename=file.xxx;"contentLength
- Lenght of the stream's contentpublic SendStreamResponse(File f)
f
- File to sendpublic SendStreamResponse(InputStream is, String contentDisposition, boolean resetHeaders)
is
- Stream to sendcontentDisposition
- Should be something like "inline; filename=file.xxx;"resetHeaders
- Indicates if headers have to be resetted. Default is false, but should be true if the response is JSP or something else that you don't want to be cached.public SendStreamResponse(File f, boolean resetHeaders)
f
- File to sendresetHeaders
- Indicates if headers have to be resetted. Default is false, but should be true if the response is JSP or something else that you don't want to be cached.protected void init(InputStream is, String contentDisposition)
public String getContentType()
public void setContentType(String contentType)
public boolean execute(CommandRequest cmdReq) throws Exception
CommandResponse
execute
in interface CommandResponse
cmdReq
- Object encapsulating the request information.Exception
Copyright © 2012-2015 JBoss by Red Hat. All Rights Reserved.