Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to check if a directory is empty?

807589Nov 6 2008 — edited Nov 6 2008
Hi All,

I have to change a code which deletes a list of files. Now as an enhancement I need to add a feature that if all the files of some folder have been removed, then I will have to remove the directory too. I am currently unable to find a way to check if the directory is empty or not.

Please help. Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 4 2008
Added on Nov 6 2008
2 comments
286 views