org.apache.cocoon.rest.controller.response
Class BinaryResponse
java.lang.Object
org.apache.cocoon.rest.controller.response.BinaryResponse
- All Implemented Interfaces:
- RestResponse
public class BinaryResponse
- extends Object
- implements RestResponse
Simple wrapper to to write binary data response to different content types.
e.g. new BinaryResponse(new ByteArrayInputStream(imageBytes), "image/jpeg"); or
return new BinaryResponse(new ByteArrayInputStream(imageBytes), "image/png");
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BinaryResponse
public BinaryResponse(InputStream stream,
String contentType)
BinaryResponse
public BinaryResponse(InputStream stream,
String contentType,
int statusCode)
execute
public void execute(OutputStream outputStream)
throws Exception
- Specified by:
execute
in interface RestResponse
- Throws:
Exception
setup
public RestResponseMetaData setup(Map<String,Object> inputParameters)
throws Exception
- Specified by:
setup
in interface RestResponse
- Throws:
Exception
Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.