开发者

How to deliver .jad file using Jersey Rest service?

开发者 https://www.devze.com 2023-03-28 11:27 出处:网络
I have to return a JavaME .jad file from restful web service (using Jersey), which is then used to install an app on a mobile phone. Before delivering the .jad file some values in there have to be cha

I have to return a JavaME .jad file from restful web service (using Jersey), which is then used to install an app on a mobile phone. Before delivering the .jad file some values in there have to be changed. I was thinking of reading the original file, change the read input and writing 开发者_C百科it back to some outputstream. Can I just return the output stream in a Jersey Rest services? Is there anything special I have to take of in terms of mime-type, etc.? Does anyone know of some kind of example code or tutorial for this purpose? Thanks in advance


Either like here: Input and Output binary streams using JERSEY? or you could send the StreamingOutput as an entity like this:

return Response.ok(streamingOutput).type("text/vnd.sun.j2me.app-descriptor");

Point is you have to use the OutputStream handed to you via the StreamingOutput.write(OutputStream outputStream) method.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号