Libraryless. Click here for Pure Java version (3639L/20K).
1 | sclass DownloadedMedia { |
2 | S cmd; |
3 | Map info; |
4 | File convertedFile; |
5 | |
6 | *(S *cmd, S json, S convertedExtension) { |
7 | info = jsonDecodeMap(json); |
8 | convertedFile = replaceExtension(get(), convertedExtension); |
9 | } |
10 | |
11 | File mediaFile aka get() { |
12 | if (convertedFile != null) ret convertedFile; |
13 | ret newFile((S) info.get("_filename")); |
14 | } |
15 | |
16 | O get(S key) { ret info.get(key); } |
17 | |
18 | toString { ret "DownloadedMedia: " + renderFileInfo(mediaFile()); } |
19 | |
20 | Map toMap() { ret info; } |
21 | } |
download show line numbers debug dex old transpilations
Travelled to 5 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx
No comments. add comment
Snippet ID: | #1032311 |
Snippet name: | DownloadedMedia |
Eternal ID of this version: | #1032311/7 |
Text MD5: | 9fcbd865c76afe46f3d4a142f051c317 |
Transpilation MD5: | 1ba5d66cf3439861489367d99a12a5f3 |
Author: | stefan |
Category: | javax / networking |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-08-27 03:33:26 |
Source code size: | 512 bytes / 21 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 168 / 310 |
Version history: | 6 change(s) |
Referenced in: | [show references] |