List of usage examples for org.apache.shiro.util StringUtils splitKeyValue
public static String[] splitKeyValue(String aLine) throws ParseException
From source file:com.caricah.iotracah.bootstrap.security.realm.impl.IOTTextConfiguredRealm.java
License:Apache License
protected static Map<String, String> toMap(Collection<String> keyValuePairs) throws ParseException { if (keyValuePairs == null || keyValuePairs.isEmpty()) { return null; }/* w w w.j a va2 s . c om*/ Map<String, String> pairs = new HashMap<String, String>(); for (String pairString : keyValuePairs) { String[] pair = StringUtils.splitKeyValue(pairString); if (pair != null) { pairs.put(pair[0].trim(), pair[1].trim()); } } return pairs; }