01: package com.mockrunner.gen.proc;
02:
03: import java.io.File;
04: import java.util.Map;
05:
06: public class GeneratorUtil {
07: public void addJavaSrcFiles(String rootDir, File dir, Map resultMap) {
08: File[] fileList = dir.listFiles();
09: for (int ii = 0; ii < fileList.length; ii++) {
10: File currentFile = fileList[ii];
11: if (currentFile.isDirectory()) {
12: addJavaSrcFiles(rootDir, currentFile, resultMap);
13: } else if (currentFile.isFile()
14: && currentFile.getName().endsWith(".java")) {
15: String key = currentFile.getPath().substring(
16: rootDir.length());
17: resultMap.put(key, currentFile);
18: }
19: }
20: }
21: }
|