Here you can find the source of loadProperties(String resource)
public static Properties loadProperties(String resource) throws IOException
//package com.java2s; //License from project: Artistic License import java.io.IOException; import java.util.Properties; public class Main { public static Properties loadProperties(String resource) throws IOException { Properties props = new Properties(); fillProperties(props, resource); return props; }/*from w w w . j a va 2 s .c o m*/ public static void fillProperties(Properties props, String resource) throws IOException { props.load(Thread.currentThread().getContextClassLoader() .getResourceAsStream(resource)); } }