List of usage examples for org.apache.commons.collections ExtendedProperties put
public synchronized V put(K key, V value)
From source file:org.opencms.util.CmsPropertyUtils.java
/** * Unescapes the given properties, unescaping "," and "=" entries.<p> * /*from w w w . ja v a 2s . c o m*/ * @param properties the properties to adjust */ public static void unescapeProperties(ExtendedProperties properties) { for (Iterator i = properties.entrySet().iterator(); i.hasNext();) { Map.Entry entry = (Map.Entry) i.next(); String key = (String) entry.getKey(); Object obj = entry.getValue(); String[] value = {}; if (obj instanceof Vector) { value = (String[]) ((Vector) obj).toArray(value); } else { String[] v = { (String) obj }; value = v; } for (int j = 0; j < value.length; j++) { value[j] = CmsStringUtil.substitute(value[j], "\\,", ","); value[j] = CmsStringUtil.substitute(value[j], "\\=", "="); } if (value.length > 1) { properties.put(key, new Vector(Arrays.asList(value))); } else { properties.put(key, value[0]); } } }