public class ReadFile {

public static void main(String[] args) {
String path = “D:\\lib”;
File f = new File(path);
File[] array = f.listFiles();
for(int i=0;i<array.length;i++){
if(array[i].isFile()){
System.out.println( array[i].getName());

}
}
}
}