The following code displays files.
Files.walk(Paths.get("E:\\pdf"))
.map(path -> path.toAbsolutePath().getFileName())
.forEach(System.out::println);
But this dosen't display pdf output why it is not working ?
Files.walk(Paths.get("E:\\pdf"))
.map(path -> path.toAbsolutePath().getFileName())
.filter(path -> path.endsWith(".pdf"))
.forEach(System.out::println);