Here you can find the source of loadFile(Path file)
public static Properties loadFile(Path file) throws IOException
//package com.java2s; //License from project: Apache License import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; import java.util.Properties; import java.io.IOException; public class Main { public static Properties loadFile(Path file) throws IOException { Properties props = new Properties(); try (InputStream in = Files.newInputStream(file)) { props.load(in);/*w w w .java 2 s . co m*/ } return props; } }