protected List<PackageMetadata> deserializeFromIndexFiles(List<File> indexFiles) { List<PackageMetadata> packageMetadataList = new ArrayList<>(); YAMLMapper yamlMapper = new YAMLMapper(); yamlMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); for (File indexFile : indexFiles) { try { MappingIterator<PackageMetadata> it = yamlMapper.readerFor(PackageMetadata.class).readValues(indexFile); while (it.hasNextValue()) { PackageMetadata packageMetadata = it.next(); packageMetadataList.add(packageMetadata); } } catch (IOException e) { throw new IllegalArgumentException("Can't parse Release manifest YAML", e); } } return packageMetadataList; }
protected List<PackageMetadata> deserializeFromIndexFiles(List<File> indexFiles) { List<PackageMetadata> packageMetadataList = new ArrayList<>(); YAMLMapper yamlMapper = new YAMLMapper(); yamlMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); for (File indexFile : indexFiles) { try { MappingIterator<PackageMetadata> it = yamlMapper.readerFor(PackageMetadata.class).readValues(indexFile); while (it.hasNextValue()) { PackageMetadata packageMetadata = it.next(); packageMetadataList.add(packageMetadata); } } catch (IOException e) { throw new IllegalArgumentException("Can't parse Release manifest YAML", e); } } return packageMetadataList; }
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); try { MappingIterator<SpringCloudDeployerApplicationManifest> it = mapper.readerFor( SpringCloudDeployerApplicationManifest.class).readValues(manifest); while (it.hasNextValue()) {
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); try { MappingIterator<SpringCloudDeployerApplicationManifest> it = mapper.readerFor( SpringCloudDeployerApplicationManifest.class).readValues(manifest); while (it.hasNextValue()) {
@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(); }