Here is the code I have thus far:
import java.io.*;
class JAVAFilter implements FilenameFilter {
public boolean accept(File dir, String name) {
return (name.endsWith(".java"));
}
}
public class tester {
public static void main(String args[])
{
FilenameFilter filter = new JAVAFilter();
File directory = new File("C:\\1.3\\");
String filename[] = directory.list(filter);
}
}
At this point, it'll store a list of all the *.java files from the directory C:\1.3\ in the string array filename. However, i'd like to store a list of all the java files also in subdirectories (preferably with their path within C:\1.3\ specified also. How do I go about doing this? Thanks!