i'm trying to use Files.list() api to list only folders, what are the missing lines that i need to add to my code in order to do that?
I have tried the files.walk method, but it didn't work. I would rather to stick to Files.list()
String dirName = ".";
try {
Files.list(Paths.get(dirName)).forEach(System.out:: println);
} catch (IOException ex) {
Logger.getLogger(ActiveDirectory.class.getName()).log(Level.SEVERE, null, ex);
}
I wanted the output to be only folders, but the output is everything including folders
.\build
.\build.xml
.\manifest.mf
.\nbproject
.\src
.\test