exception type throw fixes in IOUtils.scanDirectory method