2 Java class ManifestContents is used to deal with FDPManifest.xml file related
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 package org
.tianocore
.packaging
;
16 import org
.apache
.xmlbeans
.XmlException
;
18 import org
.tianocore
.*;
22 This class operates on FDPManifest.xml file
24 @since PackageEditor 1.0
26 public class ManifestContents
{
29 /// it is more convenient to get input stream from Jar entry of to-be-installed package file.
30 /// so i use InputStream instead of File
32 private InputStream manIs
= null;
34 FrameworkDevPkgManifestDocument manDoc
= null;
36 HeaderDocument hdr
= null;
38 FrameworkDevPkgManifestDocument
.FrameworkDevPkgManifest manRoot
= null;
40 public ManifestContents(InputStream fis
) throws XmlException
, IOException
{
43 manDoc
= FrameworkDevPkgManifestDocument
.Factory
.parse(manIs
);
44 manRoot
= manDoc
.getFrameworkDevPkgManifest();
49 Get package name from manifest file header.
53 public String
getBaseName() {
54 return manRoot
.getHeader().getPackageName().getStringValue();
58 Get package version from manifest file header.
62 public String
getVersion() {
63 return manRoot
.getHeader().getVersion();
67 Get package GUID from manifest file header.
71 public String
getGuid() {
72 return manRoot
.getHeader().getGuid().getStringValue();