Original Post
🔒 Locked
[java] Scanning directories
Advertisement
File currDir = new File(".");
String[] fileList = currDir.list(new FilenameFilter() {
public boolean accept(File dir, String name) {
//list all the files
return true;
}
});
for(int i = 0; i < fileList.length; i++) {
System.out.println("File " + i + ": " + fileList[i]);
}
Hope that helps.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement