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

11
LINES

< > BotCompany Repo | #1012229 // copyMainClassFileFromHotwiredProgram

JavaX fragment (include)

1  
static void copyMainClassFileFromHotwiredProgram(Class program, File destFile) {
2  
  L<File> files = cast get(getClassLoader(program), 'files);
3  
  for (File location : files) 
4  
    if (location.isDirectory()) {
5  
      File f = new File(location, "main.class");
6  
      if (f.exists()) ret with copyFile(f, destFile);
7  
    } else if (location.isFile()) pcall {
8  
      ret with extractFileFromZipFile(location, "main.class", destFile);
9  
    }
10  
  fail("main.class not found in: " + files);
11  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1012229
Snippet name: copyMainClassFileFromHotwiredProgram
Eternal ID of this version: #1012229/2
Text MD5: 397a6e12bce91fa862b31ad10c47ebd6
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-24 13:30:59
Source code size: 487 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 475 / 506
Version history: 1 change(s)
Referenced in: [show references]