As discussed last Friday (http://moodle.org/mod/cvsadmin/view.php?conversationid=4890#c199940):
When displaying a folder of files in a read-only mode
- in server files repository plugin
- in the new folder renderer
then don't display empty directories at all. This check needs to work recursively, so that even a folder that contains an empty folder won't be displayed.
We decided not to implement this in the File API, but just do it in the renderers and repository plugin.