Java examples for java.util:Properties File
Convert properties As Map
//package com.java2s; import java.util.HashMap; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.Map.Entry; public class Main { public static Map<String, String> propertiesAsMap(Properties properties) { Set<Entry<Object, Object>> entries = properties.entrySet(); Map<String, String> responseMap = new HashMap<String, String>(); for (Entry<Object, Object> entry : entries) { responseMap.put((String) entry.getKey(), (String) entry.getValue()); }/* w w w . ja v a2s. c om*/ return responseMap; } }