summaryrefslogtreecommitdiff
path: root/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/OpenFile.java
diff options
context:
space:
mode:
authorlhauch <lhauch@6f19259b-4bc3-4df7-8a09-765794883524>2006-10-05 23:12:07 +0000
committerlhauch <lhauch@6f19259b-4bc3-4df7-8a09-765794883524>2006-10-05 23:12:07 +0000
commitfeccee87a78e68d575dbdf44b34ca0cb5a21ea8d (patch)
treec70bdaea30cf92a8555e1013fc15565138203134 /Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/OpenFile.java
parent214b0d1914b48d651b25e58f321ddb77a46903b8 (diff)
downloadedk2-platforms-feccee87a78e68d575dbdf44b34ca0cb5a21ea8d.tar.xz
Restructuring for better separation of Tool packages.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1674 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/OpenFile.java')
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/OpenFile.java95
1 files changed, 95 insertions, 0 deletions
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/OpenFile.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/OpenFile.java
new file mode 100644
index 0000000000..32eec68258
--- /dev/null
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/OpenFile.java
@@ -0,0 +1,95 @@
+/** @file
+
+ The file provides interface to open xml file.
+
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ **/
+package org.tianocore.frameworkwizard.common;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
+import org.tianocore.FrameworkDatabaseDocument;
+import org.tianocore.ModuleSurfaceAreaDocument;
+import org.tianocore.PackageSurfaceAreaDocument;
+import org.tianocore.PlatformSurfaceAreaDocument;
+import org.tianocore.FrameworkDatabaseDocument.FrameworkDatabase;
+import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
+import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;
+import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;
+
+public class OpenFile {
+ /**
+
+ @param args
+
+ **/
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ Open specificed Msa file and read its content
+
+ @param strMsaFilePath The input data of Msa File Path
+
+ **/
+ public static ModuleSurfaceArea openMsaFile(String strMsaFilePath) throws IOException, XmlException, Exception {
+ Log.log("Open Msa", strMsaFilePath);
+ File msaFile = new File(strMsaFilePath);
+ ModuleSurfaceAreaDocument xmlMsaDoc = (ModuleSurfaceAreaDocument) XmlObject.Factory.parse(msaFile);
+ return xmlMsaDoc.getModuleSurfaceArea();
+ }
+
+ /**
+ Open specificed Spd file and read its content
+
+ @param strSpdFilePath The input data of Spd File Path
+
+ **/
+ public static PackageSurfaceArea openSpdFile(String strSpdFilePath) throws IOException, XmlException, Exception {
+ Log.log("Open Spd", strSpdFilePath);
+ File spdFile = new File(strSpdFilePath);
+ PackageSurfaceAreaDocument xmlSpdDoc = (PackageSurfaceAreaDocument) XmlObject.Factory.parse(spdFile);
+ return xmlSpdDoc.getPackageSurfaceArea();
+ }
+
+ /**
+ Open specificed Fpd file and read its content
+
+ @param strFpdFilePath The input data of Fpd File Path
+
+ **/
+ public static PlatformSurfaceArea openFpdFile(String strFpdFilePath) throws IOException, XmlException,
+ Exception {
+ Log.log("Open Fpd", strFpdFilePath);
+ File fpdFile = new File(strFpdFilePath);
+ PlatformSurfaceAreaDocument xmlFpdDoc = null;
+ xmlFpdDoc = (PlatformSurfaceAreaDocument) XmlObject.Factory.parse(fpdFile);
+ return xmlFpdDoc.getPlatformSurfaceArea();
+ }
+
+ /**
+
+ Open specificed Framework Database file and read its content
+
+ */
+ public static FrameworkDatabase openFrameworkDb(String strDbFilePath) throws IOException, XmlException, Exception {
+ Log.log("Open Framework Database", strDbFilePath);
+ File db = new File(strDbFilePath);
+ FrameworkDatabaseDocument xmlDb = null;
+ xmlDb = (FrameworkDatabaseDocument) XmlObject.Factory.parse(db);
+ return xmlDb.getFrameworkDatabase();
+ }
+}