public List listFiles(String dirPath) {
File srcDir = new File(rootPath.getAbsoluteFile(), dirPath);
File[] files = srcDir.listFiles();
List results = new ArrayList(files.length);
If dirPath doesn't refer to a directory then srcDir.listFiles() will return null, so the files.length access will cause a NullPointerException.
public List listFiles(String dirPath) {
File srcDir = new File(rootPath.getAbsoluteFile(), dirPath);
File[] files = srcDir.listFiles();
List results = new ArrayList(files.length);
If dirPath doesn't refer to a directory then srcDir.listFiles() will return null, so the files.length access will cause a NullPointerException.