This should be inside try block, given that it can throw SecurityException if folder cannot be read.