Home arrow static arrow Java Programming [Archive] - Filereader problems
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Filereader problems
This topic has 1 reply on 1 page.

Posts:1
Registered: 8/7/04
Filereader problems  
Aug 7, 2004 12:43 AM



 
I would like to know how I can read filenames and also all of the subfolders in a directory into a database. I need this code for a CD-indexer so that I can find all the files on a specific cd. Currently, I'm having troubles reading the subfolders.
 

Posts:11,200
Registered: 7/22/99
Re: Filereader problems  
Aug 7, 2004 12:59 AM (reply 1 of 1)



 
You can list the contents of a directory using the File.list() method. If you pass a FileFilter as a parameter you can restrict the listing to include only certains types of files, like .mp3's and subdirectories.

The API documentation of FIle has the full information:
http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html
 
This topic has 1 reply on 1 page.