Hi
On Thu, Aug 11, 2011 at 2:40 PM, Collard, David L (Dave)
<[email protected]> wrote:
> If you have a method such as this (taken from
>
> http://cxf.apache.org/docs/jax-rs-multiparts.html):
>
>
>
> @Produces("multipart/mixed")
>
> public MultipartBody getBooks2() {
>
> List<Attachment> atts = new LinkedList<Attachment>();
>
> atts.add(new Attachment("root", "application/json", new JSONBook()));
>
> atts.add(new Attachment("image", "application/octet-stream",
> getImageInputStream()));
>
> return new MultipartBody(atts, true);
>
> }
>
>
Return JAX-RS Response instead, that will allow you specify a
different status if needed,
ex,
if (fileNotAvailable) {
return Response.status(404).build();
} else {
return Response.ok(new MultipartBody(atts, true)).build();
}
HTH,
Sergey
>
> How would you return a different http status, such as 'NOT FOUND' ?
>
>
>
> Thanks,
>
>
>
> -- DC
>
>
--
Sergey Beryozkin
http://sberyozkin.blogspot.com
Talend - http://www.talend.com