@Test public void parseProv() throws Exception { InputStream is = getClass().getResourceAsStream("mysql-1.4.0.tgz.prov"); HelmAttributes attributes = provenanceParser.parse(is); assertThat(attributes.getName(), is(equalTo("mysql"))); assertThat(attributes.getDescription(), is(equalTo("Fast, reliable, scalable, and easy to use open-source relational database system."))); assertThat(attributes.getVersion(), is(equalTo("1.4.0"))); assertThat(attributes.getIcon(), is(equalTo("https: assertThat(attributes.getAppVersion(), is(equalTo("5.7.27"))); }
public HelmAttributes parse(final InputStream inputStream) throws IOException { HelmAttributes attributes = new HelmAttributes(); try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream))) { String line; while ((line = bufferedReader.readLine()) != null) { if (line.startsWith(HelmProperties.NAME.getPropertyName())) { attributes.setName(getValue(line)); } if (line.startsWith(HelmProperties.DESCRIPTION.getPropertyName())) { attributes.setDescription(getValue(line)); } if (line.startsWith(HelmProperties.VERSION.getPropertyName())) { attributes.setVersion(getValue(line)); } if (line.startsWith(HelmProperties.ICON.getPropertyName())) { attributes.setIcon(getValue(line)); } if (line.startsWith(HelmProperties.APP_VERSION.getPropertyName())) { attributes.setAppVersion(getValue(line)); } } } return attributes; }
ProvenanceParser { public HelmAttributes parse(final InputStream inputStream) throws IOException { HelmAttributes attributes = new HelmAttributes(); try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream))) { String line; while ((line = bufferedReader.readLine()) != null) { if (line.startsWith(HelmProperties.NAME.getPropertyName())) { attributes.setName(getValue(line)); } if (line.startsWith(HelmProperties.DESCRIPTION.getPropertyName())) { attributes.setDescription(getValue(line)); } if (line.startsWith(HelmProperties.VERSION.getPropertyName())) { attributes.setVersion(getValue(line)); } if (line.startsWith(HelmProperties.ICON.getPropertyName())) { attributes.setIcon(getValue(line)); } if (line.startsWith(HelmProperties.APP_VERSION.getPropertyName())) { attributes.setAppVersion(getValue(line)); } } } return attributes; } }
ProvenanceParser { public HelmAttributes parse(final InputStream inputStream) throws IOException { HelmAttributes attributes = new HelmAttributes(); try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream))) { String line; while ((line = bufferedReader.readLine()) != null) { if (line.startsWith(HelmProperties.NAME.getPropertyName())) { attributes.setName(getValue(line)); } if (line.startsWith(HelmProperties.DESCRIPTION.getPropertyName())) { attributes.setDescription(getValue(line)); } if (line.startsWith(HelmProperties.VERSION.getPropertyName())) { attributes.setVersion(getValue(line)); } if (line.startsWith(HelmProperties.ICON.getPropertyName())) { attributes.setIcon(getValue(line)); } if (line.startsWith(HelmProperties.APP_VERSION.getPropertyName())) { attributes.setAppVersion(getValue(line)); } } } return attributes; }  }
ProvenanceParser { public HelmAttributes parse(final InputStream inputStream) throws IOException { HelmAttributes attributes = new HelmAttributes(); try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream))) { String line; while ((line = bufferedReader.readLine()) != null) { if (line.startsWith(HelmProperties.NAME.getPropertyName())) { attributes.setName(getValue(line)); } if (line.startsWith(HelmProperties.DESCRIPTION.getPropertyName())) { attributes.setDescription(getValue(line)); } if (line.startsWith(HelmProperties.VERSION.getPropertyName())) { attributes.setVersion(getValue(line)); } if (line.startsWith(HelmProperties.ICON.getPropertyName())) { attributes.setIcon(getValue(line)); } if (line.startsWith(HelmProperties.APP_VERSION.getPropertyName())) { attributes.setAppVersion(getValue(line)); } } } return attributes; }  HelmAttributes parse(final InputStream inputStream); }
ProvenanceParser { public HelmAttributes parse(final InputStream inputStream) throws IOException { HelmAttributes attributes = new HelmAttributes(); try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream))) { String line; while ((line = bufferedReader.readLine()) != null) { if (line.startsWith(HelmProperties.NAME.getPropertyName())) { attributes.setName(getValue(line)); } if (line.startsWith(HelmProperties.DESCRIPTION.getPropertyName())) { attributes.setDescription(getValue(line)); } if (line.startsWith(HelmProperties.VERSION.getPropertyName())) { attributes.setVersion(getValue(line)); } if (line.startsWith(HelmProperties.ICON.getPropertyName())) { attributes.setIcon(getValue(line)); } if (line.startsWith(HelmProperties.APP_VERSION.getPropertyName())) { attributes.setAppVersion(getValue(line)); } } } return attributes; }  HelmAttributes parse(final InputStream inputStream);  }