From 66a07e986c8fa8487cdd90c633d56b8c85ada867 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 1 Sep 2008 20:52:44 +0000 Subject: [PATCH] remove unused code - improve path detection --- util/src/org/aspectj/util/FileUtil.java | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/util/src/org/aspectj/util/FileUtil.java b/util/src/org/aspectj/util/FileUtil.java index b0cd73a3b..fb2a7f95a 100644 --- a/util/src/org/aspectj/util/FileUtil.java +++ b/util/src/org/aspectj/util/FileUtil.java @@ -654,6 +654,19 @@ public class FileUtil { 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 * @@ -1282,6 +1295,20 @@ public class FileUtil { 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 -- 2.39.5