@Test public void testParseChartYaml() throws Exception { InputStream is = getClass().getResourceAsStream("Chart.yaml"); Map<String, Object> helmYaml = underTest.load(is); assertThat(helmYaml.get("version").toString(), is(equalTo("0.4.9"))); assertThat(helmYaml.get("name").toString(), is(equalTo("mongodb"))); assertThat(helmYaml.get("home").toString(), is(equalTo("https: assertThat(helmYaml.get("description").toString(), is(equalTo("NoSQL document-oriented database that stores JSON-like documents with" + " dynamic schemas, simplifying the integration of data in content-driven applications."))); assertThat(helmYaml.get("engine").toString(), is(equalTo("gotpl"))); assertThat(helmYaml.get("icon").toString(), is(equalTo("https: assertThat(helmYaml.get("keywords"), is(equalTo(getKeywords()))); assertThat(helmYaml.get("maintainers"), is(equalTo(getMaintainers()))); assertThat(helmYaml.get("sources"), is(equalTo(getSources()))); }
public Map<String, Object> load(InputStream is) throws IOException { checkNotNull(is); String data = IOUtils.toString(new UnicodeReader(is)); Map<String, Object> map; try { Yaml yaml = new Yaml(new SafeConstructor()); map = yaml.load(data); } catch (YAMLException e) { map = (Map<String, Object>) mapper.readValue(data, Map.class); } return map; }
YamlParser extends ComponentSupport { public Map<String, Object> load(InputStream is) throws IOException { checkNotNull(is); String data = IOUtils.toString(new UnicodeReader(is)); Map<String, Object> map; try { Yaml yaml = new Yaml(new SafeConstructor()); map = yaml.load(data); } catch (YAMLException e) { map = (Map<String, Object>) mapper.readValue(data, Map.class); } return map; } }
YamlParser extends ComponentSupport { public Map<String, Object> load(InputStream is) throws IOException { checkNotNull(is); String data = IOUtils.toString(new UnicodeReader(is)); Map<String, Object> map; try { Yaml yaml = new Yaml(new SafeConstructor()); map = yaml.load(data); } catch (YAMLException e) { map = (Map<String, Object>) mapper.readValue(data, Map.class); } return map; }  }
YamlParser extends ComponentSupport { public Map<String, Object> load(InputStream is) throws IOException { checkNotNull(is); String data = IOUtils.toString(new UnicodeReader(is)); Map<String, Object> map; try { Yaml yaml = new Yaml(new SafeConstructor()); map = yaml.load(data); } catch (YAMLException e) { map = (Map<String, Object>) mapper.readValue(data, Map.class); } return map; }  Map<String, Object> load(InputStream is); String getYamlContent(final ChartIndex index); void write(final OutputStream os, final ChartIndex index); }
YamlParser extends ComponentSupport { public Map<String, Object> load(InputStream is) throws IOException { checkNotNull(is); String data = IOUtils.toString(new UnicodeReader(is)); Map<String, Object> map; try { Yaml yaml = new Yaml(new SafeConstructor()); map = yaml.load(data); } catch (YAMLException e) { map = (Map<String, Object>) mapper.readValue(data, Map.class); } return map; }  Map<String, Object> load(InputStream is); String getYamlContent(final ChartIndex index); void write(final OutputStream os, final ChartIndex index);  }