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

14
LINES

< > BotCompany Repo | #1001461 - listDirs (only first level)

JavaX fragment (include)

1  
static L<File> listDirs(File dir) {
2  
  if (dir == null) ret emptyList();
3  
  File[] files = dir.listFiles();
4  
  new L<File> l;
5  
  if (files != null)
6  
    for (File f : files)
7  
      if (f.isDirectory())
8  
        l.add(f);
9  
  return l;
10  
}
11  
12  
static L<File> listDirs(S dir) {
13  
  ret listDirs(newFile(dir));
14  
}

Author comment

Lists dirs only

Began life as a copy of #1001459

download  show line numbers  debug dex   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1001461
Snippet name: listDirs (only first level)
Eternal ID of this version: #1001461/3
Text MD5: 677737ed39c050f6afe894d296ebfb84
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-14 17:55:31
Source code size: 306 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 428 / 648
Version history: 2 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1001461 & http://1001461.tinybrain.de