@Test public void testLoadProperties_WithUnavailableConfigFile_ThrowsIOException() throws IOException { File regularFile = new File(this.homeDirectory, this.CONFIG_FILE); if(this.regularFile.exists()){ boolean isDeleted = this.regularFile.delete(); Assert.assertTrue(isDeleted); } this.exception.expect(FileNotFoundException.class); Properties prop = FileUtil.loadProperties(regularFile.getAbsolutePath()); Assert.assertEquals("Different size of loaded properties file", 0, prop.size()); }
public static Properties loadProperties(String propertiesFilePath) throws IOException { Properties prop = new Properties(); try (FileInputStream fileInputStream = new FileInputStream(propertiesFilePath)) { prop.load(fileInputStream); } return prop; }
FileUtil { public static Properties loadProperties(String propertiesFilePath) throws IOException { Properties prop = new Properties(); try (FileInputStream fileInputStream = new FileInputStream(propertiesFilePath)) { prop.load(fileInputStream); } return prop; } }
FileUtil { public static Properties loadProperties(String propertiesFilePath) throws IOException { Properties prop = new Properties(); try (FileInputStream fileInputStream = new FileInputStream(propertiesFilePath)) { prop.load(fileInputStream); } return prop; }  }
FileUtil { public static Properties loadProperties(String propertiesFilePath) throws IOException { Properties prop = new Properties(); try (FileInputStream fileInputStream = new FileInputStream(propertiesFilePath)) { prop.load(fileInputStream); } return prop; }  static File[] getFileListFromDirectory(String directory); static Properties loadProperties(String propertiesFilePath); }
FileUtil { public static Properties loadProperties(String propertiesFilePath) throws IOException { Properties prop = new Properties(); try (FileInputStream fileInputStream = new FileInputStream(propertiesFilePath)) { prop.load(fileInputStream); } return prop; }  static File[] getFileListFromDirectory(String directory); static Properties loadProperties(String propertiesFilePath);  }