Revert "exception type throw fixes in IOUtils.scanDirectory method"

This reverts commit 08eaf071d813b06617f8e3d0f94f02c40e752d53.