Java Count Fichiers dans le dossier

File directory=new File("directory path");
    int fileCount=directory.list().length;
    System.out.println("File Count:"+fileCount);
Nimorum