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

22
LINES

< > BotCompany Repo | #2000352 // class virtual (fixed 2)

New Tinybrain snippet

class virtual {
  static java.io.File newFile(String path) {
    return new java.io.File(rebase(path));
  }
  
  static java.io.FileInputStream newFileInputStream(String path) {
    return new java.io.FileInputStream(rebase(path));
  }
  
  static java.io.FileOutputStream newFileOutputStream(String path) {
    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 #2000350

download  show line numbers   

Snippet is not live.

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

No comments. add comment

Snippet ID: #2000352
Snippet name: class virtual (fixed 2)
Eternal ID of this version: #2000352/1
Text MD5: e60d8fe0680a9400088030c7aa5ef46b
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:02:07
Source code size: 614 bytes / 22 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 553 / 110
Referenced in: [show references]