仅使用 JavaMail 下载特定的 MIMETYPE
我下载的每条消息都很大。但是,我只对 JSON MIMETYPE 感兴趣。有没有办法向服务器指定我只想下载消息的 JSON 部分?我查看了 FetchProfile 设置,但它似乎不支持这一点。
Each message that I am downloading is quite large. However, I am only interested in the JSON MIMETYPE. Is there a way to specify to the server that I am would only like to download the JSON part of the message? I have looked into the FetchProfile settings, but it does not seem to support this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想您正在使用 javamail 并且能够检索邮件,对吧?
也许你可以尝试这个:获取正文部分并检查 mimetype。
I supposed that you are using javamail and have been able to retrieve the messages right?
Perhaps you can try this: Get the bodypart and check for the mimetype.
不幸的是,一旦您进入下载消息内容的阶段,那就是全有或全无的情况。 JavaMail 遵循的标准没有指定在下载之前分离邮件内容各部分的方法;完成此类事情的唯一方法是服务器端。
Once you're at the stage of downloading the message contents it's an all-or-nothing situation, unfortunately. The standards that JavaMail adheres to don't specify a way to separate parts of message contents before downloading; the only way to accomplish that sort of thing would be server-side.