X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FMigrationTools%2Forg%2Ftianocore%2Fmigration%2FDatabase.java;h=a4b0d47872f374c599e8dc69b8eb2b5e6d167fab;hp=f33670e7f19ae7ccd518f14a6796f66c6102c285;hb=a61513d6f94b0fb4d5498609cbaef60c324858ba;hpb=719cebfea79fc6a8cdf06e1694a6596b4db69d1b diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/Database.java b/Tools/Source/MigrationTools/org/tianocore/migration/Database.java index f33670e7f1..a4b0d47872 100644 --- a/Tools/Source/MigrationTools/org/tianocore/migration/Database.java +++ b/Tools/Source/MigrationTools/org/tianocore/migration/Database.java @@ -15,13 +15,9 @@ package org.tianocore.migration; import java.io.*; import java.util.*; -public class Database { - Database() throws Exception { - if (System.getenv("WORKSPACE") == null) { - DatabasePath = "C:" + File.separator + "tianocore" + File.separator + "edk2" + File.separator + "Tools" + File.separator + "Conf" + File.separator + "Migration"; - } else { - DatabasePath = System.getenv("WORKSPACE") + File.separator + "Tools" + File.separator + "Conf" + File.separator + "Migration"; - } +public final class Database { + Database(String path) throws Exception { + DatabasePath = path; importDBLib("Library.csv"); importDBGuid("Guid.csv", "Guid"); @@ -124,7 +120,7 @@ public class Database { public String getR9Macro(String r8macro) { return hashmacro.get(r8macro).r9name; // the verification job of if the macro exists in the database is done when registering it } - + public String getR9Guidname(String r8Guid) { String temp = null; try { @@ -134,7 +130,7 @@ public class Database { } return temp; } - + public String getGuidType(String r8Guid) { String temp = null; try { @@ -144,4 +140,12 @@ public class Database { } return temp; } + + public static Database init() throws Exception { + if (System.getenv("WORKSPACE") == null) { + return new Database("C:" + File.separator + "tianocore" + File.separator + "edk2" + File.separator + "Tools" + File.separator + "Conf" + File.separator + "Migration"); + } else { + return new Database(System.getenv("WORKSPACE") + File.separator + "Tools" + File.separator + "Conf" + File.separator + "Migration"); + } + } }