]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/PackageIdentification.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 / packaging / PackageIdentification.java
CommitLineData
a13899c5 1/** @file\r
2 \r
3 The file is used to save basic information of package\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.packaging;\r
a13899c5 17\r
5a24e806 18import java.io.File;\r
19\r
20import org.tianocore.frameworkwizard.common.Tools;\r
79cb6fdb 21import org.tianocore.frameworkwizard.common.Identifications.Identification;\r
5a24e806 22import org.tianocore.frameworkwizard.workspace.Workspace;\r
a13899c5 23\r
24public class PackageIdentification extends Identification{\r
25 \r
a13899c5 26 public PackageIdentification(String name, String guid, String version){\r
27 super(name, guid, version);\r
28 }\r
29 \r
30 public PackageIdentification(String name, String guid, String version, String path){\r
31 super(name, guid, version, path);\r
32 }\r
33 \r
34 public PackageIdentification(Identification id){\r
35 super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());\r
36 }\r
5a24e806 37 \r
38 public File getSpdFile(){\r
39 File spdFile = new File(this.getPath());\r
40 return spdFile;\r
41 }\r
42 \r
43 public String toString() {\r
44 return getName() + " " + getVersion() + " [" + Tools.getRelativePath(getSpdFile().getPath(), Workspace.getCurrentWorkspace()) + "]";\r
45 }\r
d8be5b14 46 \r
47 public boolean equals(String packageGuid, String packageVersion) {\r
48 boolean b = false;\r
49 if (this.getGuid().equals(packageGuid)) {\r
50 b = true;\r
51 //\r
52 // Check Version\r
53 //\r
54 if (packageVersion != null) {\r
55 if (!Tools.isEmpty(packageVersion)) {\r
56 if (!packageVersion.equals(this.getVersion())) {\r
57 b = false;\r
58 }\r
59 }\r
60 }\r
61 }\r
62 return b;\r
63 }\r
a13899c5 64}\r