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!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.