diff options
author | 2016-10-12 11:35:52 +0800 | |
---|---|---|
committer | 2016-10-12 11:35:52 +0800 | |
commit | f297b9c44853acc95e438f8f9bc177776f6b63f3 (patch) | |
tree | 64797140c14ba5c6847d8ee97a8bf6c88e55a01d /catalog-core/catalog-mgr | |
parent | 04c464ac12f3af31f24bc1559b77037aa5306279 (diff) |
Fix bug "define csar meta in different way may cause upload package failed".
Issue-id:TOSCA-106
Change-Id: I5c4c73229787bdd17280c12d1074dffc21a1f327
Signed-off-by: nancylizi <li.zi30@zte.com.cn>
Diffstat (limited to 'catalog-core/catalog-mgr')
-rw-r--r-- | catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapperUtil.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapperUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapperUtil.java index 87346a11..763e2009 100644 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapperUtil.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapperUtil.java @@ -403,17 +403,19 @@ public class PackageWrapperUtil { reader = new BufferedReader(new FileReader(file)); String tempString = null; while ((tempString = reader.readLine()) != null) { - if (tempString.startsWith(CommonConstant.CSAR_TYPE_META)) { + int count1 = tempString.indexOf(":"); + String meta = tempString.substring(0, count1).trim(); + if (meta.equalsIgnoreCase(CommonConstant.CSAR_TYPE_META)) { int count = tempString.indexOf(":") + 1; - basicInfo.setType(EnumType.valueOf(tempString.substring(count))); + basicInfo.setType(EnumType.valueOf(tempString.substring(count).trim())); } - if (tempString.startsWith(CommonConstant.CSAR_PROVIDER_META)) { + if (meta.equalsIgnoreCase(CommonConstant.CSAR_PROVIDER_META)) { int count = tempString.indexOf(":") + 1; - basicInfo.setProvider(tempString.substring(count)); + basicInfo.setProvider(tempString.substring(count).trim()); } - if (tempString.startsWith(CommonConstant.CSAR_VERSION_META)) { + if (meta.equalsIgnoreCase(CommonConstant.CSAR_VERSION_META)) { int count = tempString.indexOf(":") + 1; - basicInfo.setVersion(tempString.substring(count)); + basicInfo.setVersion(tempString.substring(count).trim()); } } reader.close(); |