Class ContentResponse
java.lang.Object
org.gatein.pc.api.invocation.response.PortletInvocationResponse
org.gatein.pc.api.invocation.response.ContentResponse
- Direct Known Subclasses:
FragmentResponse
Data produced.
- Version:
- $Revision: 5602 $
- Author:
- Julien Viet
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int.static final int.static final int. -
Constructor Summary
ConstructorsConstructorDescriptionContentResponse(ContentResponse that, 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) ContentResponse(ResponseProperties properties, Map<String, Object> attributes, String contentType, CacheControl cacheControl) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getBytes()Return the bytes of the content held by the fragment.getChars()Return the chars of the content held by the fragment.Return the content as a string, when the character encoding is set, it will be used for binary content, otherwise theUTF-8will be used.getContent(Charset charset) Return the content as a string, the provided charset will be used for binary content.Return the content type of the generated fragment.intgetType()
-
Field Details
-
TYPE_EMPTY
public static final int TYPE_EMPTY.- See Also:
-
TYPE_CHARS
public static final int TYPE_CHARS.- See Also:
-
TYPE_BYTES
public static final int TYPE_BYTES.- See Also:
-
-
Constructor Details
-
ContentResponse
public ContentResponse(ResponseProperties properties, Map<String, Object> attributes, String contentType, String encoding, byte[] bytes, CacheControl cacheControl) -
ContentResponse
public ContentResponse(ResponseProperties properties, Map<String, Object> attributes, String contentType, String encoding, String chars, CacheControl cacheControl) -
ContentResponse
public ContentResponse(ResponseProperties properties, Map<String, Object> attributes, String contentType, CacheControl cacheControl) -
ContentResponse
-
-
Method Details
-
getEncoding
-
getProperties
-
getCacheControl
-
getAttributes
-
getType
public int getType() -
getContent
Return the content as a string, when the character encoding is set, it will be used for binary content, otherwise theUTF-8will be used.- Returns:
- the content
- Throws:
UnsupportedCharsetException- when the response encoding is not supported
-
getContent
Return the content as a string, the provided charset will be used for binary content.- Returns:
- the content
-
getBytes
Return the bytes of the content held by the fragment.- Returns:
- the bytes
- Throws:
IllegalArgumentException- if the type is not bytes
-
getChars
Return the chars of the content held by the fragment.- Returns:
- the chars
- Throws:
IllegalArgumentException- if the type is not chars
-
getContentType
Return the content type of the generated fragment.- Returns:
- the content type
-