2
I am trying to list in my project all the files that I saved previously in the program inside the query folder, however it does not only show the files, it also shows their respective paths. How do I make this function more organized only with the name of the txt files and maybe 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);
}
exit:
What version of java are you using?
– adelmo00
@adelmo00 Probably Java8, it was not in this version that lambda expressions were implemented?
– Jéf Bueno
Yes. I was going to answer, but @jbueno already did and I hope it helps you. I didn’t notice the expression lambda at the end of the line.
– adelmo00
I’m using Version 8
– Carlos Diego
@Carlosdiego you completely changed the question, putting another question, and the question has already been answered. I will return to original doubt, whenever you have a new doubt, do not change the question, accept the answer of the current and open a new.
– user28595
@Carlosdiego Keep the question as it was before and open a new one with your new doubt. This way you will end up invalidating my answer.
– Jéf Bueno
Done jbueno > http://answall.com/questions/136281/aber-arquivo-txt-dentro-de-uma-pasta-e-editar-informa%C3%A7%C3%B5es-do-arquivo
– Carlos Diego