private static void list(String path, List<String> result) {
File f = new File(path);
if(f.isDirectory()) {
File fileList = f.listFiles();
for(int i = 0; i < fileList.length; i++) {
list(fileList[i].getPath(), result);
}
} else {
if(isJsFile(f.getName())) {
result.add(f.getPath());
}
}
}
/**
* Determine whether the the specified file is a JS file. [Page]
*
* @param fileName
* @return True: is a JS file; False: not a JS file.
*/
private static boolean isJsFile(String fileName) {
//TODO use pattern!!!
return \".js\".equals(fileName.substring(fileName.length() - 3));
}
/**
* List all JS files in the specified directory(Not in their sub-directory).
*
* @param dir The specified directory.
* @return String The JS file list.
*/
private static String getSingleDirJsFileList(final String dir) {
String jsFileList;
File path = new File(dir);
jsFileList = path.list(new FilenameFilter() {
private Pattern pattern