@Test public void testReadPropertiesFileWithExistingFile() throws IOException { File baseDir = TestUtil.getBasedir("buildproperties"); Properties properties = BuildPropertiesParserImpl.readProperties(new File(baseDir, "build.properties")); Assert.assertEquals(3, properties.size()); }
protected static Properties readProperties(File propsFile) { Properties properties = new Properties(); if (propsFile.canRead()) { InputStream is = null; try { try { is = new FileInputStream(propsFile); properties.load(is); } finally { if (is != null) { is.close(); } } } catch (IOException e) { } } return properties; }
BuildPropertiesParserImpl implements BuildPropertiesParser, Disposable { protected static Properties readProperties(File propsFile) { Properties properties = new Properties(); if (propsFile.canRead()) { InputStream is = null; try { try { is = new FileInputStream(propsFile); properties.load(is); } finally { if (is != null) { is.close(); } } } catch (IOException e) { } } return properties; } }
BuildPropertiesParserImpl implements BuildPropertiesParser, Disposable { protected static Properties readProperties(File propsFile) { Properties properties = new Properties(); if (propsFile.canRead()) { InputStream is = null; try { try { is = new FileInputStream(propsFile); properties.load(is); } finally { if (is != null) { is.close(); } } } catch (IOException e) { } } return properties; } BuildPropertiesParserImpl(); protected  BuildPropertiesParserImpl(LegacySupport legacySupport, Logger logger); }
BuildPropertiesParserImpl implements BuildPropertiesParser, Disposable { protected static Properties readProperties(File propsFile) { Properties properties = new Properties(); if (propsFile.canRead()) { InputStream is = null; try { try { is = new FileInputStream(propsFile); properties.load(is); } finally { if (is != null) { is.close(); } } } catch (IOException e) { } } return properties; } BuildPropertiesParserImpl(); protected  BuildPropertiesParserImpl(LegacySupport legacySupport, Logger logger); @Override BuildProperties parse(File baseDir); @Override void dispose(); }
BuildPropertiesParserImpl implements BuildPropertiesParser, Disposable { protected static Properties readProperties(File propsFile) { Properties properties = new Properties(); if (propsFile.canRead()) { InputStream is = null; try { try { is = new FileInputStream(propsFile); properties.load(is); } finally { if (is != null) { is.close(); } } } catch (IOException e) { } } return properties; } BuildPropertiesParserImpl(); protected  BuildPropertiesParserImpl(LegacySupport legacySupport, Logger logger); @Override BuildProperties parse(File baseDir); @Override void dispose();  }