I am attempting to open a folder and list it's contents (files). Basically I have a top folder containing several project folders and within those project folders are csv's and png's. I want to be able to crack through those two folders and list the contents, then once that is complete, be able to go back out and enter the next project folder and do the same thing. So far I am able to list all the files within a specified folder. This is what I have:
import java.io.*;
public class testtwo {
public static void main(String[] args) {
testtwo directory = new testtwo();
directory.showFileList();
}
private void showFileList() {
File directory = new File("CAD_Import");
File[] filesInsideDirectory = directory.listFiles();
for(File file : filesInsideDirectory) {
System.out.println("File Name : " + file.getName());
}
}
}
Thanks!
jmpman