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

30
LINES

< > BotCompany Repo | #2000355 // class virtual (fixed 4)

New Tinybrain snippet

class virtual {
  static java.io.File newFile(String path) {
    return new java.io.File(rebase(path));
  }
  
  static java.io.File newFile(File base, String path) {
    return new java.io.File(base, path);
  }
  
  static java.io.File newFile(String base, String path) {
    return new java.io.File(rebase(base), path);
  }
  
  static java.io.FileInputStream newFileInputStream(String path) throws java.io.IOException {
    return new java.io.FileInputStream(rebase(path));
  }
  
  static java.io.FileOutputStream newFileOutputStream(String path) throws java.io.IOException {
    return new java.io.FileOutputStream(rebase(path));
  }
  
  static String virtual_baseDir = "";
  
  static String rebase(String path) {
    if (new File(path).isAbsolute())
      return path;
    else
      return new File(new File(virtual_baseDir), path).getAbsolutePath();
  }
}

Author comment

Began life as a copy of #2000354

download  show line numbers   

Snippet is not live.

Travelled to 86 computer(s): adtiomwmedle, aoiabmzegqzx, bhatertpkbcr, brfxcrgsgrhg, cahelewubzku, cbybwowwnfue, cfunsshuasjs, cmhtpxxajurv, crvwmplrxojx, dbyzmesgzjrf, ddnzoavkxhuk, dhtvkmknsjym, digkpvzjadop, dsbpoofgtjnx, dyfldxrfteug, ecqjixtmvxlp, egsshdfjpivr, exkalrxbqyxc, fnmrsykwqckh, fumpprspadck, funhxakgkfno, gavnqejikrat, gbdqvketdppm, gkwdfizivqfm, gveowxfxqtil, gwrvuhgaqvyk, hkknpzsgoixq, honjdlwrmtdu, hxnwyiuffukg, igfbtfetlyvk, ipcmaqahdjtn, ishqpsrjomds, jlatgrcjtklg, jrjpqrqxafhk, jtubtzbbkimh, kajysqoxcvfe, kiawvgutsbre, kmhbujppghqa, ldywjnwigrac, lgdvxdgcpgrv, lijxzhtxxnix, liwcxgsjrgqn, lnjhkqwteiwi, lpdgvwnxivlt, lqsqiistucwk, mmaxggujatqf, mnzieskfvskl, mqqgnosmbjvj, mrjhfnjfopze, mrmohjpeebfc, nbgitpuheiab, nmhwwpuvbanc, nrhsverhnpsn, nrtiiiyxqhmw, omrbxrqoiqeh, omzkqqnokwlv, onfqjnomoxuw, onxytkatvevr, owkcekpozlzc, ppwwtnwhztze, pyentgdyhuwx, pzhvpgtvlbxg, qbtsjoyahagl, qhcvkqotyiga, qnhezvwmdcbn, sksrqysvpwbz, skttnvmfkzhq, slhtubpyutdj, teubizvjbppd, tjmheftkjvzt, tslmcundralx, tvejysmllsmz, tzxuzeklshpk, ucpxxyxryupy, ufhdzwgrioxs, ugbnzuvxksoj, umpqpbvfwjre, uzhyvevygbcc, uzolovmvtubr, vouqrxazstgt, vqblocesogdc, whwpvezoxzgq, winwedijdyqq, zndhoewobdyk, zrzaeipbowrh, zudvenktlakg

No comments. add comment

Snippet ID: #2000355
Snippet name: class virtual (fixed 4)
Eternal ID of this version: #2000355/1
Text MD5: 5099bf5718df58190a3852b79b7b0b16
Author: stefan
Category: javax
Type: New Tinybrain snippet
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-05-12 21:06:04
Source code size: 894 bytes / 30 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 663 / 16789
Referenced in: #616 - x10.java (under development)
#621 - x11.java
#622 - x12.java (Official source for JavaX 12)
#645 - x14.java
#692 - x16.java (JavaX runner)
#750 - x25.java (JavaX)
#1000397 - _x17.java (JavaX 17, embeddable)
#1000413 - Porting JavaX 18 to Android (transpiled, EDITING)
#1000420 - JavaX 18 Android running 1000419 (ImageView test)
#1000430 - Default boot-up code for JavaX/Android 19 (old, backup)
#1000434 - _x18.java (modifying for Android)
#1000438 - Default boot-up code for JavaX/Android 19 (backup)
#1000451 - _x18.java (modified for Android, latest)
#1000508 - Transpilation of #722
#1000571 - _x18.java, final merged
#1000572 - _javax.java (JavaX 19)
#1001110 - x26.java (JavaX)
#1001148 - x27.java (JavaX)
#1001209 - Default boot-up code for JavaX/Android 26 (backup)
#1001370 - x28.java (JavaX)
#1001600 - x29.java (JavaX)
#1002665 - Default boot-up code for JavaX/Android 26 (testing, with x27) BACKUP
#1004087 - Default boot-up code for JavaX/Android 26 (testing, with x27) BACKUP
#1004182 - x30 for Android [stage 3, Java, LIVE]
#1004183 - Boot-up code for JavaX/Android (backup)
#1004305 - x31.java (JavaX)
#1004414 - class virtual (LIVE)
#1007390 - x30 for Android (backup before multiport)
#2000358 - x12.java
#2000359 - x12.java
#2000360 - x12.java
#2000388 - class x14 (embeddable)
#2000389 - class x14 (embeddable)
#2000390 - class x14 (embeddable)
#2000468 - class x16.java (embeddable)
#2000469 - class _x16 (embeddable)
#2000470 - class _x16 (embeddable, fixed)
#2000485 - _x17.java (JavaX 17, embeddable)
#2000493 - _x18.java (JavaX 18, embeddable)
#2000494 - _x18.java (JavaX 18, embeddable, fixed)
#2000495 - _x18.java (JavaX 18, embeddable, fixed 2)
#2000496 - _x18.java (JavaX 18, embeddable, fixed 3)
#2000500 - _x18.java (modified for Android, copied from #676)
#2000501 - _x18.java (modified for Android, copied from #676)
#3000382 - Answer for ferdie (>> t = 1, f = 0)