diff options
author | aclement <aclement> | 2008-09-01 20:52:44 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-09-01 20:52:44 +0000 |
commit | 66a07e986c8fa8487cdd90c633d56b8c85ada867 (patch) | |
tree | 3d293d4a7fe63f647a161e220b44ee5d0ab4d564 | |
parent | c5f29f24913fafe0983b51ee6ea175326bda4221 (diff) | |
download | aspectj-66a07e986c8fa8487cdd90c633d56b8c85ada867.tar.gz aspectj-66a07e986c8fa8487cdd90c633d56b8c85ada867.zip |
remove unused code - improve path detection
-rw-r--r-- | util/src/org/aspectj/util/FileUtil.java | 27 |
1 files changed, 27 insertions, 0 deletions
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 @@ -655,6 +655,19 @@ public class FileUtil { } /** + * 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 * * @param basedir the non-null File base directory for File to create with paths @@ -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 |