You can use a Reader to implement this (That's what i
did).
(Stripped) Example:
public class Reader extends AbstractReader implements
Poolable, Composable {
Request request = null;
Response response = null; Context context = null; ComponentManager manager = null; public void setup(SourceResolver resolver, Map
objectModel, String src, Parameters par) throws ProcessingException,
SAXException, IOException {
super.setup(resolver, objectModel, src, par); context = ObjectModelHelper.getContext(objectModel); request = ObjectModelHelper.getRequest(objectModel); response = ObjectModelHelper.getResponse(objectModel); } public void generate() throws
IOException, SAXException, ProcessingException
{
try { response.setHeader("Cache-Control", "no-cache"); response.setHeader("Pragma", "no-cache"); response.setDateHeader("Expires", 0); // out is the outputstream to write your
blob data to.
((OutputStream)out).write('The blob
data');
} } catch (Exception e) { throw new ProcessingException("Error in reader: "+e); } } public String getMimeType() {
return context.getMimeType(source.substring(source.lastIndexOf("/") + 1)); } }
----- Original Message -----
|
Title: Return BLOB Value