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

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

Introduction

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

Prototype

public static String[] splitByWholeSeparator(String str, String separator, int max) 

Source Link

Document

Splits the provided text into an array, separator string specified.

Usage

From source file:com.livinglogic.ul4.BoundStringMethodSplit.java

public static List<String> call(String object, String separator, int maxsplit) {
    if (separator == null)
        return Arrays.asList(StringUtils.splitByWholeSeparator(object, null, maxsplit + 1));
    return Arrays.asList(StringUtils.splitByWholeSeparatorPreserveAllTokens(object, separator, maxsplit + 1));
}

From source file:org.apache.storm.st.utils.StringDecorator.java

public static String[] split2(String decoratedString) {
    return StringUtils.splitByWholeSeparator(decoratedString, UNIQUE_PREFIX, 2);
}

From source file:org.kuali.kfs.sys.businessobject.lookup.BatchFileLookupableHelperServiceImpl.java

protected IOFileFilter getLastModifiedDateBasedFilter(String lastModifiedDatePattern) {
    if (StringUtils.isBlank(lastModifiedDatePattern)) {
        return null;
    }//from  w  ww. j av a2 s . com
    try {
        if (lastModifiedDatePattern.startsWith("<=")) {
            String dateString = StringUtils.removeStart(lastModifiedDatePattern, "<=");
            Date toDate = dateTimeService.convertToDate(dateString);
            return new LastModifiedDateFileFilter(null, toDate);
        }
        if (lastModifiedDatePattern.startsWith(">=")) {
            String dateString = StringUtils.removeStart(lastModifiedDatePattern, ">=");
            Date fromDate = dateTimeService.convertToDate(dateString);
            return new LastModifiedDateFileFilter(fromDate, null);
        }
        if (lastModifiedDatePattern.contains("..")) {
            String[] dates = StringUtils.splitByWholeSeparator(lastModifiedDatePattern, "..", 2);
            Date fromDate = dateTimeService.convertToDate(dates[0]);
            Date toDate = dateTimeService.convertToDate(dates[1]);
            return new LastModifiedDateFileFilter(fromDate, toDate);
        }
    } catch (ParseException e) {
        throw new RuntimeException("Can't parse date", e);
    }
    throw new RuntimeException("Unable to perform search using last modified date " + lastModifiedDatePattern);
}

From source file:org.kuali.rice.core.api.search.SearchExpressionUtils.java

public static String[] parseBinaryOperatorValues(SearchOperator operator, String expression) {
    return StringUtils.splitByWholeSeparator(expression.trim(), operator.op(), 2);
}