0

I am trying to find and print folder names through spring and jsp. I want to find folders' names and how many are there under /somefolder/ folder

I want the code to be in java style, please help!

Steve Gom
  • 75
  • 3
  • 9

1 Answers1

2

There is File#listFiles to get the files in a directory, and you can use File#isDirectory to check if those are files or directories, either by looping over the result or by using a FileFilter that you pass to listFiles.

Thilo
  • 257,207
  • 101
  • 511
  • 656