X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=vid-app-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fvid%2Fasdc%2Fbeans%2Ftosca%2FToscaMeta.java;h=a5295c4761235b62605cea35a7154d879c979137;hb=6c7dcba5be04a502a2d5de7e7c5f14eedf9eaa2a;hp=66938372e6076261f9f25e47c35c54c93c5148d9;hpb=ef3524df38879e4f070a018beb3de494cf276fee;p=vid.git diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMeta.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMeta.java index 66938372e..a5295c476 100755 --- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMeta.java +++ b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMeta.java @@ -1,9 +1,9 @@ /*- - * ============LICENSE_START======================================================= - * VID - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ + * ============LICENSE_START======================================================= + * VID + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -14,7 +14,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License. + * limitations under the License. * ============LICENSE_END========================================================= */ @@ -104,12 +104,14 @@ public class ToscaMeta { try { while ((line = br.readLine()) != null) { - final String[] entry = line.split(":"); - - if (entry.length != 2) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (more than 1 colon found on a single line"); - if (!entry[1].startsWith(" ")) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (: not immediately followed by ' ')"); - - metadata.put(entry[0], entry[1].substring(1)); + if ( line.length() > 0 ) { + final String[] entry = line.split(":"); + + if (entry.length != 2) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (more than 1 colon found on a single line"); + if (!entry[1].startsWith(" ")) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (: not immediately followed by ' ')"); + + metadata.put(entry[0], entry[1].substring(1)); + } } } catch (IOException e) { metadata.clear();