Example usage for org.apache.shiro.util StringUtils splitKeyValue

List of usage examples for org.apache.shiro.util StringUtils splitKeyValue

Introduction

In this page you can find the example usage for org.apache.shiro.util StringUtils splitKeyValue.

Prototype

public static String[] splitKeyValue(String aLine) throws ParseException 

Source Link

Usage

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;
}