KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > examples > file > ff


1 package examples.file;
2
3 import jodd.file.*;
4 import jodd.file.filters.*;
5 import java.io.*;
6
7 public class ff {
8     public static void main(String args[]) {
9         System.out.print("find file ");
10         if (args.length == 0) {
11             System.out.println("\nNeed 1 argument");
12             return;
13         }
14         System.out.println(args[0]);
15
16         System.out.println("---start---");
17         FindFile ff = new FindFile();
18         File f = ff.first(".", new WildcardFileFilter(args[0]));
19         int i = 1;
20         while (f != null) {
21             System.out.println(i + ". " + f.getName());
22             i++;
23             f = ff.next();
24         }
25         System.out.println("---end---");
26     }
27 }
28
Popular Tags