Java examples for File Path IO:Directory Content
List contents of a directory
import java.io.*; public class Main { public static void main(String[] args) { File file = new File("C://FileIO"); String[] files = file.list(); // w ww .j a v a2 s .c o m System.out.println("Listing contents of " + file.getPath()); for(int i=0 ; i < files.length ; i++) { System.out.println(files[i]); } } }