]> source.dussan.org Git - aspectj.git/commitdiff
remove unused code - improve path detection
authoraclement <aclement>
Mon, 1 Sep 2008 20:52:44 +0000 (20:52 +0000)
committeraclement <aclement>
Mon, 1 Sep 2008 20:52:44 +0000 (20:52 +0000)
util/src/org/aspectj/util/FileUtil.java

index b0cd73a3b6a2889839c4eb9ae0dc6f7d384e3008..fb2a7f95a65e343bcb10b1de1ccef4900d4f8568 100644 (file)
@@ -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