@Override public List<CloudFoundryApplicationSkipperManifest> read(String manifest) { if (canSupport(manifest)) { List<CloudFoundryApplicationSkipperManifest> applicationSpecs = new ArrayList<>(); YAMLMapper mapper = new YAMLMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); mapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true); mapper.setPropertyNamingStrategy(PropertyNamingStrategy.KEBAB_CASE); try { MappingIterator<CloudFoundryApplicationSkipperManifest> it = mapper .readerFor(CloudFoundryApplicationSkipperManifest.class) .readValues(manifest); while (it.hasNextValue()) { CloudFoundryApplicationSkipperManifest appKind = it.next(); applicationSpecs.add(appKind); } } catch (JsonMappingException e) { logger.error("Can't parse Package's manifest YAML = " + manifest); throw new SkipperException("JsonMappingException - Can't parse Package's manifest YAML = " + manifest, e); } catch (IOException e) { logger.error("Can't parse Package's manifest YAML = " + manifest); throw new SkipperException("IOException - Can't parse Package's manifest YAML = " + manifest, e); } return applicationSpecs; } return Collections.emptyList(); }
@Override public List<CloudFoundryApplicationSkipperManifest> read(String manifest) { if (canSupport(manifest)) { List<CloudFoundryApplicationSkipperManifest> applicationSpecs = new ArrayList<>(); YAMLMapper mapper = new YAMLMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); mapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true); mapper.setPropertyNamingStrategy(PropertyNamingStrategy.KEBAB_CASE); try { MappingIterator<CloudFoundryApplicationSkipperManifest> it = mapper .readerFor(CloudFoundryApplicationSkipperManifest.class) .readValues(manifest); while (it.hasNextValue()) { CloudFoundryApplicationSkipperManifest appKind = it.next(); applicationSpecs.add(appKind); } } catch (JsonMappingException e) { logger.error("Can't parse Package's manifest YAML = " + manifest); throw new SkipperException("JsonMappingException - Can't parse Package's manifest YAML = " + manifest, e); } catch (IOException e) { logger.error("Can't parse Package's manifest YAML = " + manifest); throw new SkipperException("IOException - Can't parse Package's manifest YAML = " + manifest, e); } return applicationSpecs; } return Collections.emptyList(); }