How can I return a Zip file from my Java server-side using JAX-RS?

后端 未结 4 552
自闭症患者
自闭症患者 2021-01-19 04:12

I want to return a zipped file from my server-side java using JAX-RS to the client.

I tried the following code,

@GET
public Response get() throws Exc         


        
4条回答
  •  悲哀的现实
    2021-01-19 04:39

    I'm not sure I it's possible in Jersey to just return a stream as result of annotated method. I suppose that rather stream should be opened and content of the file written to the stream. Have a look at this blog post. I guess You should implement something similar.

提交回复
热议问题