Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

21
LINES

< > BotCompany Repo | #1032311 // DownloadedMedia

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (3639L/20K).

sclass DownloadedMedia {
  S cmd;
  Map info;
  File convertedFile;
  
  *(S *cmd, S json, S convertedExtension) {
    info = jsonDecodeMap(json);
    convertedFile = replaceExtension(get(), convertedExtension);
  }
  
  File mediaFile aka get() {
    if (convertedFile != null) ret convertedFile;
    ret newFile((S) info.get("_filename"));
  }
  
  O get(S key) { ret info.get(key); }
  
  toString { ret "DownloadedMedia: " + renderFileInfo(mediaFile()); }
  
  Map toMap() { ret info; }
}

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: 167 / 309
Version history: 6 change(s)
Referenced in: #1034167 - Standard Classes + Interfaces (LIVE, continuation of #1003674)