The lists of files or file names returned by the File listFiles() and list() methods include all files and directories.
Tutorial Details:
The lists of files or file names returned by the File listFiles() and list() methods include all files and directories. The files/directories that are included may be restricted by passing a java.io.FileFilter to these methods.
Creating a java.io.FileFilter
Create a class that implements the javax.io.FileFilter interface, which means that you must define the boolean accept() method. For example, to create a filter that accepts all directories and HTML files.
Rate Tutorial: http://www.roseindia.net/java/java-tips/io/10file/40listfile-filefilter.shtml
Read
Tutorial at: Click here to view the tutorial
Rate Tutorial: java.io.FileFilter
View Tutorial: java.io.FileFilter
Related
Tutorials:
|