public class ContentResponse extends PortletInvocationResponse
| Modifier and Type | Field and Description |
|---|---|
static int |
TYPE_BYTES
.
|
static int |
TYPE_CHARS
.
|
static int |
TYPE_EMPTY
.
|
| Constructor and Description |
|---|
ContentResponse(ContentResponse that,
CacheControl cacheControl) |
ContentResponse(ResponseProperties properties,
Map<String,Object> attributes,
String contentType,
CacheControl cacheControl) |
ContentResponse(ResponseProperties properties,
Map<String,Object> attributes,
String contentType,
String encoding,
byte[] bytes,
CacheControl cacheControl) |
ContentResponse(ResponseProperties properties,
Map<String,Object> attributes,
String contentType,
String encoding,
String chars,
CacheControl cacheControl) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
getAttributes() |
byte[] |
getBytes()
Return the bytes of the content held by the fragment.
|
CacheControl |
getCacheControl() |
String |
getChars()
Return the chars of the content held by the fragment.
|
String |
getContent()
Return the content as a string, when the character encoding is set, it will be used
for binary content, otherwise the
UTF-8 will be used. |
String |
getContent(Charset charset)
Return the content as a string, the provided charset will be used for binary content.
|
String |
getContentType()
Return the content type of the generated fragment.
|
String |
getEncoding() |
ResponseProperties |
getProperties() |
int |
getType() |
public static final int TYPE_EMPTY
public static final int TYPE_CHARS
public static final int TYPE_BYTES
public ContentResponse(ResponseProperties properties, Map<String,Object> attributes, String contentType, String encoding, byte[] bytes, CacheControl cacheControl)
public ContentResponse(ResponseProperties properties, Map<String,Object> attributes, String contentType, String encoding, String chars, CacheControl cacheControl)
public ContentResponse(ResponseProperties properties, Map<String,Object> attributes, String contentType, CacheControl cacheControl)
public ContentResponse(ContentResponse that, CacheControl cacheControl)
public String getEncoding()
public ResponseProperties getProperties()
public CacheControl getCacheControl()
public int getType()
public String getContent() throws UnsupportedCharsetException
UTF-8 will be used.UnsupportedCharsetException - when the response encoding is not supportedpublic String getContent(Charset charset)
public byte[] getBytes()
throws IllegalArgumentException
IllegalArgumentException - if the type is not bytespublic String getChars() throws IllegalArgumentException
IllegalArgumentException - if the type is not charspublic String getContentType()
Copyright © 2003-2016 GateIn. All Rights Reserved.