]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/SelectModuleBelong.java
1. Fix EDKT501: New MSA get "Please type a complete file path" waring and can't proceed
[mirror_edk2.git] / Tools / Java / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / SelectModuleBelong.java
index e2b306ac9e43a83af3f7aac5422879b88701339c..6572067efe564aaa0e1bb3c6b46e960cf284d19d 100644 (file)
@@ -517,7 +517,7 @@ public class SelectModuleBelong extends IDialog {
         // Check if path is valid\r
         //\r
         File f = new File(path);\r
-        if (!f.isFile()) {\r
+        if (!f.isAbsolute()) {\r
             Log.wrn("New File", "Please type a complete file path!");\r
             return false;\r
         }\r
@@ -539,15 +539,13 @@ public class SelectModuleBelong extends IDialog {
             }\r
             \r
             //\r
-            // Check if path already exists\r
-            // Currently we allow user to add multiple msa files in one same directory\r
-            // Remove this checkpoint\r
+            // Check if the module is in selected package\r
             //\r
-//            if (GlobalData.isDuplicateRelativePath(Tools.getFilePathOnly(modulePath), mode)) {\r
-//                Log.wrn("New File", "There already exists a same directory with a module");\r
-//                return false;\r
-//            }\r
-            \r
+            if (Tools.getFilePathOnly(modulePath).indexOf(Tools.getFilePathOnly(packagePath)) < 0) {\r
+                Log.wrn("New File", "This module should be in the directory of selected package!");\r
+                return false;\r
+            }\r
+                      \r
             //\r
             // Check if Guid+Version is unique\r
             //\r