cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin" <sbery...@progress.com>
Subject Re: jax-rs byte stream result
Date Mon, 19 Oct 2009 12:41:08 GMT
You can do it like this :

return Response.ok().type("text/bar").entity(stream).build()

where stream is a StreamingOutput  or just InputStream or may be Source or File, etc

cheers, Sergey

----- Original Message ----- 
From: "Benson Margulies" <bimargulies@gmail.com>
To: <users@cxf.apache.org>
Sent: Monday, October 19, 2009 1:25 PM
Subject: Re: jax-rs byte stream result


> Can I make an object that implements Response and also StreamingOutput?
> 
> On Fri, Oct 16, 2009 at 5:07 PM, Sergey Beryozkin <sergey.beryozkin@iona.com
>> wrote:
> 
>>
>> Hi Benson
>>
>> You might want to return a StreamingOutput and have @Produces("CSV type").
>> Or return it as a multipart/mixed, and have @Multipart annotation on the
>> method level which will specify the type for the root type
>>
>> cheers, Sergey
>>
>>
>> bimargulies wrote:
>> >
>> > This may win some sort of a prize for a simple question.
>> >
>> > I want to define a JAX-RS function where the function provides, as a
>> > response, the entire content of the response plus the content type. I
>> > might,
>> > for example, be returning an entire CSV spreadsheet.
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/jax-rs-byte-stream-result-tp25931526p25932363.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>>
>

Mime
View raw message