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

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

Introduction

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

Prototype

public static String[] split(String line, char delimiter) 

Source Link

Usage

From source file:com.ceecloud.shiro.CasRealm.java

License:Apache License

/**
 * Split a string into a list of not empty and trimmed strings, delimiter is a comma.
 * //  w w  w . jav a 2s  .c  om
 * @param s the input string
 * @return the list of not empty and trimmed strings
 */
private List<String> split(String s) {
    List<String> list = new ArrayList<String>();
    String[] elements = StringUtils.split(s, ',');
    if (elements != null && elements.length > 0) {
        for (String element : elements) {
            if (StringUtils.hasText(element)) {
                list.add(element.trim());
            }
        }
    }
    return list;
}

From source file:com.zrk.oauthclient.shiro.support.UsernamePasswordAndClientRealm.java

License:Apache License

/**
 * Split a string into a list of not empty and trimmed strings, delimiter is
 * a comma./*w w w .j  a  v  a 2s .  c  o m*/
 *
 * @param s
 *            the input string
 * @return the list of not empty and trimmed strings
 */
protected List<String> split(final String s) {
    final List<String> list = new ArrayList<String>();
    final String[] elements = StringUtils.split(s, ',');
    if (elements != null && elements.length > 0) {
        for (final String element : elements) {
            if (StringUtils.hasText(element)) {
                list.add(element.trim());
            }
        }
    }
    return list;
}

From source file:io.buji.pac4j.ClientRealm.java

License:Apache License

/**
 * Split a string into a list of not empty and trimmed strings, delimiter is
 * a comma./*from   ww w. j  a v  a 2  s  .  c  om*/
 *
 * @param s
 *            the input string
 * @return the list of not empty and trimmed strings
 */
protected List<String> split(final String s) {
    final List<String> list = new ArrayList<>();
    final String[] elements = StringUtils.split(s, ',');
    if (elements != null && elements.length > 0) {
        for (final String element : elements) {
            if (StringUtils.hasText(element)) {
                list.add(element.trim());
            }
        }
    }
    return list;
}