I'm trying to list in my project all the files I've saved in the program before in the Query folder, but it does not only show the files, it also shows their respective paths. How do I make this function more organized only with the names of the txt files and who knows even a method to search by name?
File arquivo;
Files.walk(Paths.get("C:\Users\Dhyego\Dropbox\Projeto Software\Main\Consultas")).forEach(filePath -> {
if (Files.isRegularFile(filePath)) {
System.out.println(filePath);
}
output: