Here you can find the source of loadProperties(String propertiesFile)
private static Properties loadProperties(String propertiesFile) throws IOException
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Properties; public class Main { private static Properties loadProperties(String propertiesFile) throws IOException { if (propertiesFile != null) { File file = new File(propertiesFile); if (file.exists()) { Properties properties = new Properties(); FileInputStream inputStream = new FileInputStream(propertiesFile); try { properties.load(inputStream); } finally { inputStream.close(); }// ww w. java 2 s. c o m return properties; } else { throw new FileNotFoundException(propertiesFile); } } else { return null; } } }