[VID-12] Delivery of remaining features for v1.1
[vid.git] / vid-app-common / src / main / java / org / openecomp / vid / asdc / beans / tosca / ToscaMeta.java
index 6693837..a5295c4 100755 (executable)
@@ -1,9 +1,9 @@
 /*-\r
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+ * ============LICENSE_START=======================================================\r
+ * VID\r
+ * ================================================================================\r
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
+ * ================================================================================\r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
  * You may obtain a copy of the License at\r
@@ -14,7 +14,7 @@
  * distributed under the License is distributed on an "AS IS" BASIS,\r
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
  * See the License for the specific language governing permissions and\r
- * limitations under the License.
+ * limitations under the License.\r
  * ============LICENSE_END=========================================================\r
  */\r
 \r
@@ -104,12 +104,14 @@ public class ToscaMeta {
                \r
                try {\r
                        while ((line = br.readLine()) != null) {\r
-                               final String[] entry = line.split(":");\r
-                               \r
-                               if (entry.length != 2) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (more than 1 colon found on a single line");\r
-                               if (!entry[1].startsWith(" ")) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (: not immediately followed by ' ')");\r
-                               \r
-                               metadata.put(entry[0], entry[1].substring(1));\r
+                               if ( line.length() > 0 ) {\r
+                                       final String[] entry = line.split(":");\r
+                                       \r
+                                       if (entry.length != 2) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (more than 1 colon found on a single line");\r
+                                       if (!entry[1].startsWith(" ")) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (: not immediately followed by ' ')");\r
+                                       \r
+                                       metadata.put(entry[0], entry[1].substring(1));\r
+                               }\r
                        }\r
                } catch (IOException e) {\r
                        metadata.clear();\r