static java.io.File virtual_newFile(String path) {
return new java.io.File(virtual_rebase(path));
}
static java.io.FileInputStream virtual_newFileInputStream(String path) {
return new java.io.FileInputStream(virtual_rebase(path));
}
static java.io.FileInputStream virtual_newFileOutputStream(String path) {
return new java.io.FileOutputStream(virtual_rebase(path));
}
static String virtual_baseDir = "";
static String virtual_rebase(String path) {
if (new File(path).isAbsolute())
return path;
else
return new File(new File(virtual_baseDir), path).getPath();
}Began life as a copy of #2000345
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: | #2000346 |
| Snippet name: | Virtualized java.io file functions (fixed) |
| Eternal ID of this version: | #2000346/1 |
| Text MD5: | 789862473b0d7080014d9dc2a6b53996 |
| Author: | stefan |
| Category: | javax |
| Type: | New Tinybrain snippet |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2015-05-11 17:52:40 |
| Source code size: | 601 bytes / 20 lines |
| Pitched / IR pitched: | No / Yes |
| Views / Downloads: | 971 / 205 |
| Referenced in: | [show references] |