Example usage for org.apache.commons.lang StringUtils split

List of usage examples for org.apache.commons.lang StringUtils split

Introduction

In this page you can find the example usage for org.apache.commons.lang StringUtils split.

Prototype

public static String[] split(String str, String separatorChars) 

Source Link

Document

Splits the provided text into an array, separators specified.

Usage

From source file:com.netflix.paas.cassandra.keys.KeyspaceKey.java

public KeyspaceKey(String schemaName) {
    String parts[] = StringUtils.split(schemaName, ".");
    Preconditions.checkState(parts.length == 2,
            String.format("Schema name must have format <cluster>.<keyspace> ('%s')", schemaName));

    this.clusterKey = new ClusterKey(parts[0], null); // TODO
    this.keyspaceName = parts[1];
    this.schemaName = schemaName;
}

From source file:com.intel.cosbench.driver.generator.SequentialIntGenerator.java

private static SequentialIntGenerator tryParse(String pattern) {
    pattern = StringUtils.substringBetween(pattern, "(", ")");
    String[] args = StringUtils.split(pattern, ",");
    int lower = Integer.parseInt(args[0]);
    int upper = Integer.parseInt(args[1]);
    return new SequentialIntGenerator(lower, upper);
}

From source file:com.backelite.sonarqube.swift.lang.core.Swift.java

public String[] getFileSuffixes() {

    return StringUtils.split(SwiftConstants.FILE_SUFFIXES, ",");
}

From source file:com.vaushell.tools.xmldirtyparser.XMLPath.java

public XMLPath(String path) {
    init();/*from   ww w .j a  va 2  s .c om*/

    for (String element : StringUtils.split(path, "/")) {
        if (element.startsWith("@")) {
            addElementLast(new XMLPathProperty(element.substring(1)));
        } else {
            addElementLast(new XMLPathElement(element));
        }
    }
}

From source file:com.mmj.app.common.cookie.parser.CookieUtils.java

/**
 * ?CookieNameConfig??Map<CookieKeyEnum,String>.?CookieNameCookieKey
 * /*  w ww.j av a2s  .  c  om*/
 * @return ?emptyMap
 */
public static Map<CookieKeyEnum, String> strToKVMap(String value, CookieNameConfig cookieNameConfig) {
    // a=11&b=22
    String[] kvs = StringUtils.split(value, COOKIE_MAP_SEPARATOR_CHAR);
    if (kvs == null || kvs.length == 0) {
        return Collections.<CookieKeyEnum, String>emptyMap();
    }
    Map<CookieKeyEnum, String> kvMap = new HashMap<CookieKeyEnum, String>();
    for (String kv : kvs) {
        int offset = kv.indexOf(COOKIE_KEY_VALUE_SEPARATOR_CHAR);
        if (offset > 0 && offset < kv.length()) {
            CookieKeyEnum key = CookieKeyEnum.getEnum(kv.substring(0, offset));
            if (key != null) {
                if (cookieNameConfig.isKeyWithIn(key)) {
                    kvMap.put(key, kv.substring(offset + 1, kv.length()));
                } else {
                    logger.error("?" + cookieNameConfig.getCookieName() + "?Cookiekey" + key
                            + "?Cookie name ");
                }
            }
        }
    }
    return kvMap;
}

From source file:com.github.hexosse.pluginframework.pluginapi.command.type.ArgTypeStringList.java

@Override
public List<String> get(String string) {
    return Arrays.asList(StringUtils.split(string, " "));
}

From source file:com.swtxml.swt.metadata.WidgetRegistry.java

public WidgetRegistry() {
    String widgetClasses = ResourceUtils.toString(ResourceUtils.getClassResource(this.getClass(), "txt"));
    for (String line : StringUtils.split(widgetClasses, "\n")) {
        String[] parts = StringUtils.split(line, '=');
        String className = parts[0].trim();
        String[] allowedStyles = (parts.length > 1) ? StringUtils.split(parts[1].trim(), ", ")
                : new String[] {};
        widgetStylesByClassName.put(className, allowedStyles);
    }/*from w ww.ja v a 2  s  .c  om*/
}

From source file:com.intel.cosbench.driver.generator.UniformIntGenerator.java

private static UniformIntGenerator tryParse(String pattern) {
    pattern = StringUtils.substringBetween(pattern, "(", ")");
    String[] args = StringUtils.split(pattern, ',');
    int lower = Integer.parseInt(args[0]);
    int upper = (args.length == 2) ? Integer.parseInt(args[1]) : MAXupper;
    return new UniformIntGenerator(lower, upper);
}

From source file:com.backelite.sonarqube.objectivec.lang.core.ObjectiveC.java

public String[] getFileSuffixes() {

    return StringUtils.split(ObjectiveCConstants.FILE_SUFFIXES, ",");
}

From source file:com.ning.hfind.primary.NamePrimary.java

@Override
public boolean passesFilter(FileAttributes attributes) {
    String[] fullPath = StringUtils.split(attributes.getPath(), "/");
    String filename = fullPath[fullPath.length - 1];

    return matcher.matches(filename, pattern);
}