|
Java™ by example!
|
|
|
How do I list the contents of a directory?
Use the File class. Here's an example:
If you want to enable wildcards, you can do all the customization yourself using FilenameFilter. The following example shows you how to list the .java files in the directory specified at command line:
Further Information
Author of answer: Joris Van den Bogaert
Comments
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|