Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

7
LINES

< > BotCompany Repo | #1035263 // baseDirInZip

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (9855L/57K).

1  
// Name of base dir (dir all files in zip are in)
2  
// e.g. "myDir" or "myDir/subDir"
3  
// Returns "" when no common base dir
4  
sS baseDirInZip(File zip) {
5  
  S prefix = commonPrefix(listZip(zip));
6  
  ret takeFirst(prefix, indexOf(prefix, '/'));
7  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035263
Snippet name: baseDirInZip
Eternal ID of this version: #1035263/1
Text MD5: 53dc245a1784b02efa25d6658a616e6d
Transpilation MD5: 64f2b6406327ea7b184c93ed9bb50856
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-04-28 15:16:48
Source code size: 245 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 134 / 193
Referenced in: [show references]