return (File[]) result.toArray(new File[result.size()]);
}
+ /**
+ * Recursively list .class files in specified directory
+ *
+ * @return List of File objects
+ */
+ public static List listClassFiles(File dir) {
+ ArrayList result = new ArrayList();
+ if ((null != dir) && dir.canRead()) {
+ listClassFiles(dir, result);
+ }
+ return result;
+ }
+
/**
* Convert String[] paths to File[] as offset of base directory
*
return LangUtil.sleepUntil(++delayUntil);
}
+ private static void listClassFiles(final File baseDir, ArrayList result) {
+ File[] files = baseDir.listFiles();
+ for (int i = 0; i < files.length; i++) {
+ File f = files[i];
+ if (f.isDirectory()) {
+ listClassFiles(f, result);
+ } else {
+ if (f.getName().endsWith(".class")) {
+ result.add(f);
+ }
+ }
+ }
+ }
+
private static void listFiles(final File baseDir, ArrayList result, FileFilter filter) {
File[] files = baseDir.listFiles();
// hack https://bugs.eclipse.org/bugs/show_bug.cgi?id=48650