dloy wrote:
> I need to set the name of a file returned over http as a stream in
> Jersey. Does Jersey have a mechanism for setting the
> Content-Disposition header on a response (at this point I am not using
> multi-part).
> Thanks
> David
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
If your resource method returns a javax.ws.rs.core.Response instead of
an entity object directly, you can use the response builder APIs to add
whatever headers you would like (or set a response status of other than
200). For example:
@GET
@Path("...")
@Produces("...")
public Response report() {
MyEntity entity = ...; // The data object to be written out,
could be String or whatever
return Response.ok(entity).header("Content-Disposition",
"...").build();
}
Craig