I guess there are so many ways to make what you want. Here's a way that I use. With the commons.io
library you can iterate over the files in a directory. You must use the FileUtils.iterateFiles
method and you can process each file.
You can find the information here: http://commons.apache.org/proper/commons-io/download_io.cgi
Here's an example:
Iterator it = FileUtils.iterateFiles(new File("C:/"), null, false);
while(it.hasNext()){
System.out.println(((File) it.next()).getName());
}
You can change null
and put a list of extentions if you wanna filter. Example: {".xml",".java"}