KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > List


1 import jcifs.netbios.NbtAddress;
2 import jcifs.smb.SmbFile;
3 import java.util.Date JavaDoc;
4
5 public class List {
6
7     public static void main( String JavaDoc[] argv ) throws Exception JavaDoc {
8
9         SmbFile file = new SmbFile( argv[0] );
10
11         long t1 = System.currentTimeMillis();
12         SmbFile[] files = file.listFiles();
13         long t2 = System.currentTimeMillis() - t1;
14
15         for( int i = 0; i < files.length; i++ ) {
16             System.out.println( " " + files[i].getURL().toExternalForm() + " ");
17         }
18         System.out.println();
19         System.out.println( files.length + " files in " + t2 + "ms" );
20     }
21 }
22
Popular Tags