Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Iterable<FileSystem.Dir> getAllDirs(FileSystem.Dir directory) {
- List<FileSystem.Dir> dirs = new ArrayList<>();
- helper(directory,dirs);
- return dirs;
- }
- private static void helper(FileSystem.Dir directory, List<FileSystem.Dir> list) {
- list.add(directory);
- for(FileSystem.Dir d : directory.getDirs()) {
- helper(d,list);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement