Java tutorial
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static void mergePropertiesIntoMap(Properties props, Map map) { if (map == null) { throw new IllegalArgumentException("Map must not be null"); } else { if (props != null) { Enumeration en = props.propertyNames(); while (en.hasMoreElements()) { String key = (String) en.nextElement(); map.put(key, props.getProperty(key)); } } } } }