Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting a directory Listing

Status
Not open for further replies.

fatcodeguy

Programmer
Feb 25, 2002
281
CA
Hi! How would I get a directory listing in Java?
 
Assuming you have the name of a directory in String file_name,

Code:
String[] files;
File f = new File(file_name);
if (f.isDirectory())
   files = f.list();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top