1 | class virtual {
|
2 | static java.io.File newFile(String path) {
|
3 | return new java.io.File(rebase(path)); |
4 | } |
5 | |
6 | static java.io.FileInputStream newFileInputStream(String path) {
|
7 | return new java.io.FileInputStream(rebase(path)); |
8 | } |
9 | |
10 | static java.io.FileOutputStream newFileOutputStream(String path) {
|
11 | return new java.io.FileOutputStream(rebase(path)); |
12 | } |
13 | |
14 | static String virtual_baseDir = ""; |
15 | |
16 | static String rebase(String path) {
|
17 | if (new File(path).isAbsolute()) |
18 | return path; |
19 | else |
20 | return new File(new File(virtual_baseDir), path).getAbsolutePath(); |
21 | } |
22 | } |
Began life as a copy of #2000350
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: | 756 / 160 |
| Referenced in: | [show references] |