ParameterTool extends ExecutionConfig.GlobalJobParameters implements Serializable, Cloneable { public static ParameterTool fromPropertiesFile(String path) throws IOException { File propertiesFile = new File(path); return fromPropertiesFile(propertiesFile); } private  ParameterTool(Map<String, String> data); static ParameterTool fromArgs(String[] args); static ParameterTool fromPropertiesFile(String path); static ParameterTool fromPropertiesFile(File file); static ParameterTool fromPropertiesFile(InputStream inputStream); static ParameterTool fromMap(Map<String, String> map); static ParameterTool fromSystemProperties(); @Override boolean equals(Object o); @Override int hashCode(); @PublicEvolving Set<String> getUnrequestedParameters(); int getNumberOfParameters(); String get(String key); String getRequired(String key); String get(String key, String defaultValue); boolean has(String value); int getInt(String key); int getInt(String key, int defaultValue); long getLong(String key); long getLong(String key, long defaultValue); float getFloat(String key); float getFloat(String key, float defaultValue); double getDouble(String key); double getDouble(String key, double defaultValue); boolean getBoolean(String key); boolean getBoolean(String key, boolean defaultValue); short getShort(String key); short getShort(String key, short defaultValue); byte getByte(String key); byte getByte(String key, byte defaultValue); Configuration getConfiguration(); Properties getProperties(); void createPropertiesFile(String pathToFile); void createPropertiesFile(String pathToFile, boolean overwrite); ParameterTool mergeWith(ParameterTool other); @Override Map<String, String> toMap();  }
@Test public void testFromPropertiesFile() throws IOException { File propertiesFile = tmp.newFile(); Properties props = new Properties(); props.setProperty("input", "myInput"); props.setProperty("expectedCount", "15"); try (final OutputStream out = new FileOutputStream(propertiesFile)) { props.store(out, "Test properties"); } ParameterTool parameter = ParameterTool.fromPropertiesFile(propertiesFile.getAbsolutePath()); Assert.assertEquals(2, parameter.getNumberOfParameters()); validate(parameter); parameter = ParameterTool.fromPropertiesFile(propertiesFile); Assert.assertEquals(2, parameter.getNumberOfParameters()); validate(parameter); try (FileInputStream fis = new FileInputStream(propertiesFile)) { parameter = ParameterTool.fromPropertiesFile(fis); } Assert.assertEquals(2, parameter.getNumberOfParameters()); validate(parameter); }