String strFile = "";
String strFilePath = [Name of the directory from where u want the list of files.] eg : "C://windows//";
 
 File file = new File(strFilePath);
 File[] f = file.listFiles();
                  if (f != null)
                  {   
                     for(int i = 0; i < f.length; i++)
                     {
                     
                        if(!(f[i].isDirectory())) 
                        {    
                           strFile = f[i].getName();
                           System.out.println("File: " + strFile);
                        }
                    }
                 }
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of chenghong
Sent: Thursday, July 05, 2001 2:13 PM
To: [EMAIL PROTECTED]
Subject: does anyone how to list all files in the specific directory ?

does anyone how to capture all filename in a directory ??
 
thanks
cheng hong.

Reply via email to