Here you can find the source of getFiles(String path)
private static List<String> getFiles(String path)
//package com.java2s; //License from project: Apache License import java.io.File; import java.util.ArrayList; import java.util.List; public class Main { private static List<String> getFiles(String path) { List<String> classes = new ArrayList<String>(); for (File file : new File(path).listFiles()) { if (file.getName().endsWith(".java")) { classes.add(file.getPath()); } else if (file.isDirectory() && !file.getName().startsWith(".")) { classes.addAll(getFiles(file.getAbsolutePath())); }/*from ww w . j a va 2 s . co m*/ } return classes; } }