Java tutorial
import java.io.IOException; import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.attribute.FileTime; import java.util.concurrent.TimeUnit; import static java.nio.file.LinkOption.NOFOLLOW_LINKS; public class Main { public static void main(String[] args) { Path path = Paths.get("C:/tutorial/Java/JavaFX"); //no filter applyied try (DirectoryStream<Path> ds = Files.newDirectoryStream(path)) { for (Path file : ds) { System.out.println(file.getFileName()); } } catch (IOException e) { System.err.println(e); } } }