Here you can find the source of loadProperties(String fileName)
public static Properties loadProperties(String fileName)
//package com.java2s; //License from project: Apache License import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.Properties; public class Main { public static Properties loadProperties(String fileName) { Properties properties = null; InputStream stream = null; try {/*ww w.j av a 2 s .c o m*/ stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName); if (null == stream) { throw new FileNotFoundException(fileName + "is Not Found"); } properties = new Properties(); properties.load(stream); } catch (IOException e) { if (null != stream) { try { stream.close(); } catch (IOException e1) { e1.printStackTrace(); } } } return properties; } }