]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/MigrationTools/org/tianocore/migration/Common.java
enhance ForDoAll
[mirror_edk2.git] / Tools / Source / MigrationTools / org / tianocore / migration / Common.java
index ca51ed43adf4b4ea3bfa951300301a70f7340bf1..19f64f7e512ea5dc874bc73714e755eff8f8340b 100644 (file)
@@ -148,7 +148,9 @@ public final class Common {
                File test;\r
 \r
                if (type == DIR || type == BOTH) {\r
-                       fda.toDo(path);\r
+                       if (fda.dirFilter(path)) {\r
+                               fda.run(path);\r
+                       }\r
                }\r
                for (int i = 0 ; i < list.length ; i++) {\r
                        test = new File(path + File.separator + list[i]);\r
@@ -156,13 +158,19 @@ public final class Common {
                                toDoAll(path + File.separator + list[i], fda, type);\r
                        } else {\r
                                if (type == FILE || type == BOTH) {\r
-                                       fda.toDo(path + File.separator + list[i]);\r
+                                       if (fda.fileFilter(path + File.separator + list[i])) {\r
+                                               fda.run(path + File.separator + list[i]);\r
+                                       }\r
                                }\r
                        }\r
                }\r
        }\r
        \r
        public static interface ForDoAll {\r
-               public void toDo(String filepath) throws Exception;\r
+               public void run(String filepath) throws Exception;\r
+               \r
+               public boolean dirFilter(String filepath);\r
+               \r
+               public boolean fileFilter(String filepath);\r
        }\r
 }\r