X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FJava%2FSource%2FFrameworkWizard%2Fsrc%2Forg%2Ftianocore%2Fframeworkwizard%2Fcommon%2FGlobalData.java;h=ed175e53430a01af51227f21f748707651dbe338;hp=83a6dd052aac7ef57eafc6cfa6e1565e81808a0d;hb=fc87d0ba587c48f1c068f44e2d45c7ccb8828aed;hpb=b53fedc9613700b1d6e5118a2ea14b51a050bf21 diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/GlobalData.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/GlobalData.java index 83a6dd052a..ed175e5343 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/GlobalData.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/GlobalData.java @@ -210,8 +210,8 @@ public class GlobalData { @return **/ - public static ModuleIdentification findModuleIdByGuidVersion(String moduleGuid, String moduleVersion, - String packageGuid, String packageVersion) { + public static ModuleIdentification findModuleId(String moduleGuid, String moduleVersion, String packageGuid, + String packageVersion) { ModuleIdentification mid = null; for (int index = 0; index < vModuleList.size(); index++) { if (vModuleList.elementAt(index).equals(moduleGuid, moduleVersion, packageGuid, packageVersion)) { @@ -230,7 +230,7 @@ public class GlobalData { @return **/ - public static PackageIdentification findPackageIdByGuidVersion(String packageGuid, String packageVersion) { + public static PackageIdentification findPackageId(String packageGuid, String packageVersion) { PackageIdentification pid = null; for (int index = 0; index < vPackageList.size(); index++) { if (vPackageList.elementAt(index).equals(packageGuid, packageVersion)) { @@ -249,7 +249,7 @@ public class GlobalData { @return **/ - public static PlatformIdentification findPlatformIdByGuidVersion(String platformGuid, String platformVersion) { + public static PlatformIdentification findPlatformId(String platformGuid, String platformVersion) { PlatformIdentification pid = null; for (int index = 0; index < vPlatformList.size(); index++) { if (vPlatformList.elementAt(index).equals(platformGuid, platformVersion)) { @@ -259,4 +259,42 @@ public class GlobalData { } return pid; } + + /** + + @param relativePath + @param mode + @return + + **/ + public static boolean isDuplicateRelativePath(String relativePath, int mode) { + if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) { + for (int index = 0; index < vModuleList.size(); index++) { + String path = vModuleList.elementAt(index).getPath(); + if (Tools.getFilePathOnly(path).equals(relativePath)) { + return true; + } + } + } + + if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) { + for (int index = 0; index < vPackageList.size(); index++) { + String path = vPackageList.elementAt(index).getPath(); + if (Tools.getFilePathOnly(path).equals(relativePath)) { + return true; + } + } + } + + if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) { + for (int index = 0; index < vPlatformList.size(); index++) { + String path = vPlatformList.elementAt(index).getPath(); + if (Tools.getFilePathOnly(path).equals(relativePath)) { + return true; + } + } + } + + return false; + } }