@Test public void loadConfig() throws Exception { String content = "" + METRIC_PERSISTENCE_PROPERTY + "=" + Boolean.TRUE.toString() + "\n" + LOG_PERSISTENCE_PROPERTY + "=" + Boolean.TRUE.toString() + "\n" + BINARY_PERSISTENCE_PROPERTY + "=" + Boolean.TRUE.toString() + "\n"; File config = File.createTempFile("test_config", null); Files.writeToFile(config, content, StandardCharsets.UTF_8); Map<String, String> properties = ConfigFileUtil.loadConfig(config.getAbsolutePath()); assertThat(properties).containsEntry(METRIC_PERSISTENCE_PROPERTY, Boolean.TRUE.toString()); assertThat(properties).containsEntry(LOG_PERSISTENCE_PROPERTY, Boolean.TRUE.toString()); assertThat(properties).containsEntry(BINARY_PERSISTENCE_PROPERTY, Boolean.TRUE.toString()); config.delete(); }
public static Map<String, String> loadConfig(String config) throws IOException { Properties properties = new Properties(); properties.load(Files.asCharSource(new File(config), StandardCharsets.UTF_8).openStream()); return Maps.fromProperties(properties); }
ConfigFileUtil { public static Map<String, String> loadConfig(String config) throws IOException { Properties properties = new Properties(); properties.load(Files.asCharSource(new File(config), StandardCharsets.UTF_8).openStream()); return Maps.fromProperties(properties); } }
ConfigFileUtil { public static Map<String, String> loadConfig(String config) throws IOException { Properties properties = new Properties(); properties.load(Files.asCharSource(new File(config), StandardCharsets.UTF_8).openStream()); return Maps.fromProperties(properties); } private  ConfigFileUtil(); }
ConfigFileUtil { public static Map<String, String> loadConfig(String config) throws IOException { Properties properties = new Properties(); properties.load(Files.asCharSource(new File(config), StandardCharsets.UTF_8).openStream()); return Maps.fromProperties(properties); } private  ConfigFileUtil(); static Map<String, String> loadConfig(String config); static boolean isMetricPersistenceEnabled(Map<String, String> properties); static boolean isLogPersistenceEnabled(Map<String, String> properties); static boolean isBinaryPersistenceEnabled(Map<String, String> properties); }
ConfigFileUtil { public static Map<String, String> loadConfig(String config) throws IOException { Properties properties = new Properties(); properties.load(Files.asCharSource(new File(config), StandardCharsets.UTF_8).openStream()); return Maps.fromProperties(properties); } private  ConfigFileUtil(); static Map<String, String> loadConfig(String config); static boolean isMetricPersistenceEnabled(Map<String, String> properties); static boolean isLogPersistenceEnabled(Map<String, String> properties); static boolean isBinaryPersistenceEnabled(Map<String, String> properties); static final String CONFIG_DIR; static final String METRIC_PERSISTENCE_PROPERTY; static final String LOG_PERSISTENCE_PROPERTY; static final String BINARY_PERSISTENCE_PROPERTY; }