Advertisement
morty0505

Untitled

Nov 2nd, 2016
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. public static Iterable<FileSystem.Dir> getAllDirs(FileSystem.Dir directory) {
  2. List<FileSystem.Dir> dirs = new ArrayList<>();
  3.  
  4. helper(directory,dirs);
  5.  
  6. return dirs;
  7. }
  8.  
  9. private static void helper(FileSystem.Dir directory, List<FileSystem.Dir> list) {
  10. list.add(directory);
  11. for(FileSystem.Dir d : directory.getDirs()) {
  12. helper(d,list);
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement