sS javaMail_messageContentToText(O content) ctex {
if (content == null) null;
if (isString(content)) ret (S) content;
if (content instanceof Multipart) {
Multipart mp = cast content;
int n = mp.getCount();
new L<S> l;
for i to n: pcall-short {
Part part = mp.getBodyPart(i);
S type = part.getContentType();
print("partType: " + type);
O partContent = part.getContent();
print("partContent " + (i+1) + "/" + n + ": " + className(partContent));
l.add(type + " / " + className(partContent));
l.add(indentx(javaMail_messageContentToText(partContent)));
}
ret joinWithEmptyLines(l);
}
ret "Unknown content type: " + className(content);
}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: | 881 / 902 |
| Version history: | 7 change(s) |
| Referenced in: | [show references] |