1 | sS javaMail_messageContentToText(O content) ctex { |
2 | if (content == null) null; |
3 | if (isString(content)) ret (S) content; |
4 | if (content instanceof Multipart) { |
5 | Multipart mp = cast content; |
6 | int n = mp.getCount(); |
7 | new L<S> l; |
8 | for i to n: pcall-short { |
9 | Part part = mp.getBodyPart(i); |
10 | S type = part.getContentType(); |
11 | print("partType: " + type); |
12 | O partContent = part.getContent(); |
13 | print("partContent " + (i+1) + "/" + n + ": " + className(partContent)); |
14 | l.add(type + " / " + className(partContent)); |
15 | l.add(indentx(javaMail_messageContentToText(partContent))); |
16 | } |
17 | ret joinWithEmptyLines(l); |
18 | } |
19 | ret "Unknown content type: " + className(content); |
20 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1016833 |
Snippet name: | javaMail_messageContentToText |
Eternal ID of this version: | #1016833/8 |
Text MD5: | e53de510f41610f87705c570827c2645 |
Author: | stefan |
Category: | javax / mail |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-10-26 19:37:00 |
Source code size: | 727 bytes / 20 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 394 / 445 |
Version history: | 7 change(s) |
Referenced in: | [show references] |