FileUtils: improve listContents implementation

This change adds support for two optional flags: recurse and filesOnly.
If the recurse flag is true, directory contents are computed
recursively. If the filesOnly flag is true, directories themselves are
excluded from the resulting collection.

The previous listContents and appendContents method signatures have been
retained, with recurse=true and filesOnly=true, which was the default
intended behavior.

This change also fixes a bug in the implementation: directories were
being erroneously included in the result when listing inside a JAR file.
(The unit test did not catch it because it did not test with a JAR that
included any directory entries, only files in subdirectories.)
FileUtilsTest: expand testListContents()

It now tests with and without recursion,
and with and without directory inclusion.