Here you can find the source of load(Class type, String resource, Properties map)
public static void load(Class type, String resource, Properties map) throws IOException
//package com.java2s; import java.io.IOException; import java.io.InputStream; import java.util.Properties; import java.util.Set; public class Main { public static void load(Class type, String resource, Properties map) throws IOException { load(type, resource, map, true); }/* www .j a va2s . co m*/ public static void load(Class type, String resource, Properties map, boolean trim) throws IOException { InputStream inputStream = type.getResourceAsStream(resource); if (inputStream == null) throw new IllegalArgumentException( "unable to load resource: " + resource + ", from: " + type.getPackage().getName()); map.load(inputStream); inputStream.close(); if (!trim) return; Set<String> names = map.stringPropertyNames(); for (String name : names) { String value = map.getProperty(name); if (value != null) value = value.trim(); map.remove(name); map.setProperty(name.trim(), value); } } }