org.apache.cocoon.rest.controller.response
Class TextResponse
java.lang.Object
org.apache.cocoon.rest.controller.response.TextResponse
- All Implemented Interfaces:
- RestResponse
public class TextResponse
- extends Object
- implements RestResponse
Simple wrapper to to write string data response to different content types.
e.g. new TextResponse(dataJson.toString(), "application/json") or
return new TextResponse(test, "text/plain")
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextResponse
public TextResponse(String data,
String contentType)
TextResponse
public TextResponse(String data,
String contentType,
int statusCode)
setup
public RestResponseMetaData setup(Map<String,Object> inputParameters)
throws Exception
- Specified by:
setup
in interface RestResponse
- Throws:
Exception
execute
public void execute(OutputStream outputStream)
throws Exception
- Specified by:
execute
in interface RestResponse
- Throws:
Exception
getStatusCode
public int getStatusCode()
setStatusCode
public void setStatusCode(int statusCode)
getCharset
public String getCharset()
setCharset
public void setCharset(String charset)
Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.