]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/toolchain/ConfigReader.java
moved exception and logger classes to org.tianocore.common package
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / toolchain / ConfigReader.java
index 0472265d399f0194b103a2745521ee8cee9100b2..6e26adee0136c1d6b40998259d76998223c8c821 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   ConfigReader class.\r
 /** @file\r
   ConfigReader class.\r
-  \r
-  ConfigReader is used to read tool chain config file with flat format. \r
-  \r
+\r
+  ConfigReader is used to read tool chain config file with flat format.\r
+\r
 Copyright (c) 2006, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 Copyright (c) 2006, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -14,7 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/\r
 package org.tianocore.build.toolchain;\r
 \r
 **/\r
 package org.tianocore.build.toolchain;\r
 \r
-import org.tianocore.build.exception.EdkException;\r
+import org.tianocore.common.exception.EdkException;\r
 \r
 import java.io.BufferedReader;\r
 import java.io.File;\r
 \r
 import java.io.BufferedReader;\r
 import java.io.File;\r
@@ -23,10 +23,10 @@ import java.util.ArrayList;
 import java.util.List;\r
 \r
 /**\r
 import java.util.List;\r
 \r
 /**\r
-  \r
+\r
   ConfigReader is used to read tool chain config file with flat format. Comments\r
   is line starting with character '#'.\r
   ConfigReader is used to read tool chain config file with flat format. Comments\r
   is line starting with character '#'.\r
-  \r
+\r
   @since GenBuild 1.0\r
 **/\r
 public class ConfigReader {\r
   @since GenBuild 1.0\r
 **/\r
 public class ConfigReader {\r
@@ -35,14 +35,14 @@ public class ConfigReader {
 \r
 \r
     /**\r
 \r
 \r
     /**\r
-      Public construct method. \r
+      Public construct method.\r
     **/\r
     public ConfigReader () {\r
     }\r
 \r
     /**\r
       Default filepath is ".".\r
     **/\r
     public ConfigReader () {\r
     }\r
 \r
     /**\r
       Default filepath is ".".\r
-    \r
+\r
       @param filename the config file name like "target.txt"\r
       @return the variables defined in file\r
     **/\r
       @param filename the config file name like "target.txt"\r
       @return the variables defined in file\r
     **/\r
@@ -52,8 +52,8 @@ public class ConfigReader {
 \r
     /**\r
       Get all variables defined in config file. the config file format is flat\r
 \r
     /**\r
       Get all variables defined in config file. the config file format is flat\r
-      with "A=B". If line started with '#' looks as comments. \r
-    \r
+      with "A=B". If line started with '#' looks as comments.\r
+\r
       @param confPath the path of config file\r
       @param filename the file name of the config file\r
       @return the variables defined in the config file\r
       @param confPath the path of config file\r
       @param filename the file name of the config file\r
       @return the variables defined in the config file\r
@@ -78,7 +78,7 @@ public class ConfigReader {
                 // without '=', or start with '='\r
                 //\r
                 int index;\r
                 // without '=', or start with '='\r
                 //\r
                 int index;\r
-                if (str.length() == 0 || str.startsWith("#") || \r
+                if (str.length() == 0 || str.startsWith("#") ||\r
                     (index = str.indexOf('=')) <= 0) {\r
                     continue;\r
                 }\r
                     (index = str.indexOf('=')) <= 0) {\r
                     continue;\r
                 }\r
@@ -89,7 +89,7 @@ public class ConfigReader {
                 valueList.add(str.substring(index + 1).trim());\r
             }\r
         } catch (Exception e) {\r
                 valueList.add(str.substring(index + 1).trim());\r
             }\r
         } catch (Exception e) {\r
-            throw new EdkException("Process file [" + filename + "] error. \n" + e.getMessage());\r
+            throw new EdkException("ERROR Processing file [" + filename + "].\n" + e.getMessage());\r
         }\r
 \r
         String[][] definitions = new String[2][keyList.size()];\r
         }\r
 \r
         String[][] definitions = new String[2][keyList.size()];\r
@@ -101,7 +101,7 @@ public class ConfigReader {
 \r
     public static synchronized ToolChainMap parseToolChainConfig(File ConfigFile) throws EdkException {\r
         ToolChainMap map = new ToolChainMap();\r
 \r
     public static synchronized ToolChainMap parseToolChainConfig(File ConfigFile) throws EdkException {\r
         ToolChainMap map = new ToolChainMap();\r
-    \r
+\r
         try {\r
             FileReader reader = new FileReader(ConfigFile);\r
             BufferedReader in = new BufferedReader(reader);\r
         try {\r
             FileReader reader = new FileReader(ConfigFile);\r
             BufferedReader in = new BufferedReader(reader);\r
@@ -114,7 +114,7 @@ public class ConfigReader {
                 // without '=', or start with '='\r
                 //\r
                 int index;\r
                 // without '=', or start with '='\r
                 //\r
                 int index;\r
-                if (str.length() == 0 || str.startsWith("#") || \r
+                if (str.length() == 0 || str.startsWith("#") ||\r
                     (index = str.indexOf('=')) <= 0) {\r
                     continue;\r
                 }\r
                     (index = str.indexOf('=')) <= 0) {\r
                     continue;\r
                 }\r
@@ -126,7 +126,7 @@ public class ConfigReader {
                 map.put(key, value);\r
             }\r
         } catch (Exception e) {\r
                 map.put(key, value);\r
             }\r
         } catch (Exception e) {\r
-            throw new EdkException("Process file [" + ConfigFile.getAbsolutePath() + "] error. \n" + e.getMessage());\r
+            throw new EdkException("ERROR Processing file [" + ConfigFile.getAbsolutePath() + "].\n" + e.getMessage());\r
         }\r
 \r
         return map;\r
         }\r
 \r
         return map;\r