/Users/lyon/j4p/src/futils/Find.java
|
1 package futils;
2
3 import java.awt.*;
4 import java.io.File;
5 import java.util.Vector;
6
7 public class Find {
8
9 public static void allWild(String wild) {
10
11 Vector allFiles = new Vector();
12
13 FileDialog fd =
14 new FileDialog(
15 new Frame(),
16 "select file");
17 fd.show();
18 String dirName = fd.getDirectory();
19 fd.dispose();
20 recurseWild(
21 allFiles,
22 new File(dirName),
23 wild);
24
25 System.out.println("allFiles length=" + allFiles.size());
26
27 }
28
29 public static void recurseWild(Vector allFiles, File dir, String wild) {
30 allFiles.addElement(Ls.getWildFiles(dir, wild));
31 File dirs[] = Ls.getDirFiles(dir);
32
33 for (int i = 0; i < dirs.length; i++)
34 recurseWild(allFiles, dirs[i], wild);
35 }
36
37 }
38
39
40
41