]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/PlatformIdentification.java
1. Fix EDKT457 Multiple FPD, MSA or SPD files in a directory is prohibited
[mirror_edk2.git] / Tools / Java / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / platform / PlatformIdentification.java
CommitLineData
a13899c5 1/** @file\r
2 \r
3 The file is used to save basic information of platform\r
4 \r
5 Copyright (c) 2006, Intel Corporation\r
6 All rights reserved. This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10 \r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13 \r
14 **/\r
15\r
16package org.tianocore.frameworkwizard.platform;\r
17\r
5a24e806 18\r
19import java.io.File;\r
20\r
21import org.tianocore.frameworkwizard.common.Tools;\r
79cb6fdb 22import org.tianocore.frameworkwizard.common.Identifications.Identification;\r
5a24e806 23import org.tianocore.frameworkwizard.workspace.Workspace;\r
a13899c5 24\r
25public class PlatformIdentification extends Identification{\r
55a2762d 26\r
a13899c5 27 public PlatformIdentification(String name, String guid, String version, String path){\r
28 super(name, guid, version, path);\r
29 }\r
30 \r
a13899c5 31 public PlatformIdentification(Identification id){\r
32 super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());\r
33 }\r
5a24e806 34 \r
35 public File getFpdFile(){\r
36 File fpdFile = new File(this.getPath());\r
37 return fpdFile;\r
38 }\r
39 \r
40 public String toString() {\r
41 return getName() + " " + getVersion() + " [" + Tools.getRelativePath(getFpdFile().getPath(), Workspace.getCurrentWorkspace()) + "]";\r
42 }\r
d8be5b14 43 \r
44 public boolean equals(String platformGuid, String platformVersion) {\r
45 boolean b = false;\r
46 if (this.getGuid().equals(platformGuid)) {\r
47 b = true;\r
48 //\r
49 // Check Version\r
50 //\r
51 if (platformVersion != null) {\r
52 if (!Tools.isEmpty(platformVersion)) {\r
53 if (!platformVersion.equals(this.getVersion())) {\r
54 b = false;\r
55 }\r
56 }\r
57 }\r
58 }\r
59 return b;\r
60 }\r
a13899c5 61}