1 | static java.io.File virtual_newFile(String path) { |
2 | return new java.io.File(virtual_rebase(path)); |
3 | } |
4 | |
5 | static java.io.FileInputStream virtual_newFileInputStream(String path) { |
6 | return new java.io.FileInputStream(virtual_rebase(path)); |
7 | } |
8 | |
9 | static java.io.FileInputStream virtual_newFileOutputStream(String path) { |
10 | return new java.io.FileOutputStream(virtual_rebase(path)); |
11 | } |
12 | |
13 | static String virtual_baseDir = ""; |
14 | |
15 | static String virtual_rebase(String path) { |
16 | return new File(new File(virtual_baseDir), path).getPath(); |
17 | } |
Snippet is not live.
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
ID | Author/Program | Comment | Date |
---|---|---|---|
285 | #1000604 (pitcher) | 2015-08-18 00:54:17 | |
240 | #1000610 (pitcher) | Edit suggestion: !636 !629 main { static Object androidContext; static String programID; public static void main(String[] args) throws Exception { 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) { return new File(new File(virtual_baseDir), path).getPath(); } }} | 2015-08-18 00:52:32 |
Snippet ID: | #2000345 |
Snippet name: | Virtualized java.io file functions |
Eternal ID of this version: | #2000345/1 |
Text MD5: | 71321020b1484c10118b6708b2e23b3f |
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:47:26 |
Source code size: | 537 bytes / 17 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 821 / 159 |
Referenced in: | [show references] |