如何使用 Jersey Rest 服务传送 .jad 文件?
我必须从 Restful Web 服务(使用 Jersey)返回 JavaME .jad 文件,然后使用该文件在手机上安装应用程序。在交付 .jad 文件之前,必须更改其中的一些值。我正在考虑读取原始文件,更改读取的输入并将其写回某个输出流。我可以只返回 Jersey Rest 服务中的输出流吗?在哑剧类型等方面我有什么特别需要注意的吗?有谁知道用于此目的的某种示例代码或教程? 提前致谢
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 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要么像这里:
使用 JERSEY 输入和输出二进制流?
或者您可以将 StreamingOutput 作为实体发送,如下所示:
要点是您必须使用通过
StreamingOutput.write(OutputStream outputStream)
方法传递给您的OutputStream
。Either like here:
Input and Output binary streams using JERSEY?
or you could send the StreamingOutput as an entity like this:
Point is you have to use the
OutputStream
handed to you via theStreamingOutput.write(OutputStream outputStream)
method.