Here you can find the source of loadProperties(Properties properties, Class clazz, String propDir, String name)
public static void loadProperties(Properties properties, Class clazz, String propDir, String name)
//package com.java2s; import java.io.*; import java.util.*; public class Main { public static void loadProperties(Properties properties, Class clazz, String propDir, String name) { // load system defaults try {/*from w w w . j a v a2 s.c o m*/ properties.load(clazz.getResourceAsStream(name)); } catch (IOException ioe) { System.err.println("Could not load aid property file: " + name); System.err.println(ioe); } // load user defaults try { if ((propDir != null) && !propDir.equals(".") && !propDir.equals("")) { name = propDir + File.separator + name; } properties.load(new FileInputStream(name)); // System.out.println("Loaded user property file: "+name); } catch (IOException ioe) { } } }