[2.8.x] NEXUS-6485: Optimizing Local discovery

Instead of walking whole directory, we do walk only
the needed depth.

As a consequence, potentially including empty
directories as well.

Backport of
https://github.com/sonatype/nexus-oss/pull/430

Issue
https://issues.sonatype.org/browse/NEXUS-6485

CI
https://bamboo.zion.sonatype.com/browse/NX-OSSF47