Libraryless. Click here for Pure Java version (2765L/16K).
1 | // subPath is relative and with slashes |
2 | static InputStream inputStreamForFileInDirOrZip(File location, S subPath) ctex { |
3 | if (location.isDirectory()) { |
4 | File f = new File(location, subPath); |
5 | ret f.exists() ? newFileInputStream(f) : null; |
6 | } else if (location.isFile()) { |
7 | InputStream in = zipFileInputStream(location, subPath); |
8 | if (in != null) ret in; |
9 | } |
10 | null; |
11 | } |
Began life as a copy of #1012231
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
Snippet ID: | #1031474 |
Snippet name: | inputStreamForFileInDirOrZip |
Eternal ID of this version: | #1031474/4 |
Text MD5: | 8af744851a882bd3c95ca9de6be1b172 |
Transpilation MD5: | 2a13f010930e3733f02398149b4d831e |
Author: | stefan |
Category: | javax / io |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-06-14 05:24:53 |
Source code size: | 391 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 236 / 301 |
Version history: | 3 change(s) |
Referenced in: | [show references] |