ResponseAdapter
DaemonResponseAdapter
, EmbeddedResponseAdapter
, QuartzJobResponseAdapter
, ShellResponseAdapter
public class BasicResponseAdapter extends AbstractResponseAdapter
adaptee
Constructor | Description |
---|---|
BasicResponseAdapter(java.lang.Object adaptee) |
Instantiates a new Basic response adapter.
|
BasicResponseAdapter(java.lang.Object adaptee,
java.io.Writer writer) |
Instantiates a new Basic response adapter.
|
Modifier and Type | Method | Description |
---|---|---|
void |
flush() |
|
java.lang.String |
getContentType() |
Returns the content type used for the MIME body sent in this response.
|
java.lang.String |
getEncoding() |
Returns the name of the character encoding (MIME charset) used for the body
sent in this response.
|
java.io.OutputStream |
getOutputStream() |
Returns a
OutputStream suitable for writing binary data in the response. |
java.io.Writer |
getWriter() |
Returns a
Writer object that can send character text to the client. |
java.lang.String |
redirect(RedirectResponseRule redirectResponseRule) |
Redirects a client to a new URL.
|
void |
redirect(java.lang.String target) |
Redirects a client to a new URL.
|
void |
setContentType(java.lang.String contentType) |
Sets the content type of the response being sent to the client,
if the response has not been committed yet.
|
void |
setEncoding(java.lang.String encoding) |
Sets the character encoding of the response being sent to the client.
|
protected void |
setOutputStream(java.io.OutputStream outputStream) |
|
protected void |
setWriter(java.io.Writer writer) |
addHeader, containsHeader, getHeader, getHeaderNames, getHeaders, getHeaders, getStatus, setHeader, setStatus, touchHeaders
getAdaptee
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addHeader, containsHeader, getHeader, getHeaderNames, getHeaders, getHeaders, getStatus, setHeader, setStatus, touchHeaders
public BasicResponseAdapter(java.lang.Object adaptee)
adaptee
- the adaptee objectpublic BasicResponseAdapter(java.lang.Object adaptee, java.io.Writer writer)
adaptee
- the adaptee objectwriter
- the writer to outputpublic java.lang.String getEncoding()
ResponseAdapter
String
specifying the name of the character encoding,
for example, UTF-8public void setEncoding(java.lang.String encoding)
ResponseAdapter
encoding
- a String
specifying only the character set
defined by IANA Character Sets (http://www.iana.org/assignments/character-sets)public java.lang.String getContentType()
ResponseAdapter
String
specifying the content type,
for example, text/html
, or nullpublic void setContentType(java.lang.String contentType)
ResponseAdapter
contentType
- a String
specifying the MIME type of the contentpublic java.io.OutputStream getOutputStream() throws java.io.IOException
ResponseAdapter
OutputStream
suitable for writing binary data in the response.OutputStream
for writing binary datajava.io.IOException
- if an input or output exception occursprotected void setOutputStream(java.io.OutputStream outputStream)
public java.io.Writer getWriter() throws java.io.IOException
ResponseAdapter
Writer
object that can send character text to the client.Writer
object that can return character data to the clientjava.io.IOException
- if an input or output exception occursprotected void setWriter(java.io.Writer writer)
public void redirect(java.lang.String target) throws java.io.IOException
ResponseAdapter
target
- the redirect targetjava.io.IOException
- if an input or output exception occurspublic java.lang.String redirect(RedirectResponseRule redirectResponseRule)
ResponseAdapter
redirectResponseRule
- the redirect response rulepublic void flush()
Copyright © 2008–2018 The Aspectran Project. All rights reserved.