Libraryless. Click here for Pure Java version (2854L/17K).
1 | static File mapMethodLike defaultExtension(S ext, File file) { |
2 | if (empty(ext)) ret file; |
3 | if (file == null || fileHasAnyExtensionAtAll(file)) ret file; |
4 | ret appendToFileName(addDotPrefix(ext), file); |
5 | } |
6 | |
7 | sS defaultExtension(S ext, S fileName) { |
8 | if (empty(ext)) ret fileName; |
9 | if (fileName == null || contains(fileName, '.')) ret fileName; |
10 | ret rjoin(addDotPrefix(ext), fileName); |
11 | } |
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
Snippet ID: | #1030630 |
Snippet name: | defaultExtension |
Eternal ID of this version: | #1030630/7 |
Text MD5: | 84eb0434f22ceade08a20c120ff2bb3e |
Transpilation MD5: | 5c4f90be2f90c118a8df1df29eb7aad9 |
Author: | stefan |
Category: | javax / io |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-02-09 10:27:00 |
Source code size: | 398 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 200 / 284 |
Version history: | 6 change(s) |
Referenced in: | [show references] |