Utility.java with scanDirectory function.