开发者

How to deliver .jad file using Jersey Rest service?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜