Here you can find the source of loadProperties(Class> clazz, String name)
public static Properties loadProperties(Class<?> clazz, String name) throws IOException
//package com.java2s; /*//from w w w . j a v a 2 s. c o m * SK's Minecraft Launcher * Copyright (C) 2010-2014 Albert Pham <http://www.sk89q.com> and contributors * Please see LICENSE.txt for license information. */ import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.util.Properties; public class Main { public static Properties loadProperties(Class<?> clazz, String name) throws IOException { Properties prop = new Properties(); InputStream in = null; try { in = clazz.getResourceAsStream(name); prop.load(in); } finally { closeQuietly(in); } return prop; } public static void closeQuietly(Closeable closeable) { try { if (closeable != null) { closeable.close(); } } catch (IOException e) { } } }