08 February 2005 - java_dev (original) (raw)
| | 09:10 am - ex_juan_gan - using loops to scan directory tree I think I got it. Use double loop. No recursion necessary (it is hidden in tree() method). import static com.myjavatools.lib.Files.*; .......... for (File dir : tree(new File("."))) { System.out.println(dir); for (File f : files(dir)) { System.out.println(" " + f); } } Check out myjavatools.com - lib, version 5. |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |