Java Count -Dateien im Ordner

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