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

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

Introduction

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

Prototype

public static String stripEnd(String str, String stripChars) 

Source Link

Document

Strips any of a set of characters from the end of a String.

Usage

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

public static String call(String object) {
    return StringUtils.stripEnd(object, null);
}

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

public static String call(String object, String chars) {
    return StringUtils.stripEnd(object, chars);
}

From source file:com.googlesource.gerrit.plugins.supermanifest.StringUtil.java

public static String stripAndAddCharsAtEnd(String str, String chs) {
    return StringUtils.stripEnd(str, chs) + chs;
}

From source file:com.gemstone.gemfire.management.internal.cli.parser.preprocessor.PreprocessorUtils.java

public static TrimmedInput simpleTrim(String input) {
    if (input != null) {
        // First remove the trailing white spaces, we do not need those
        if (!containsOnlyWhiteSpaces(input)) {
            input = StringUtils.stripEnd(input, null);
        }// ww w.  j a  v a  2 s . com
        String output = input.trim();
        return new TrimmedInput(output, input.length() - output.length());
    } else {
        return null;
    }
}

From source file:de.langmi.javasnippets.stringutils.StringUtilsTest.java

@Test
public void testStripEnd() {
    // Does StringUtils.stripEnd removes whitespace, even when it is only a 
    // one-character string
    assertEquals("", StringUtils.stripEnd(" ", null));
}

From source file:com.dcsquare.hivemq.spi.topic.PermissionTopicMatcher.java

public boolean matches(final String topicSubscription, final String actualTopic) throws InvalidTopicException {

    final String subscription = StringUtils.stripEnd(topicSubscription, "/");

    String topic = actualTopic;//from  w  ww  .j  a  va  2  s.  co  m

    if (actualTopic.length() > 1) {
        topic = StringUtils.stripEnd(actualTopic, "/");

    }
    if (StringUtils.containsNone(topicSubscription, "#+")) {

        return subscription.equals(topic);
    }
    return matchesWildcards(subscription, topic);
}

From source file:com.vmware.thinapp.common.datastore.client.DatastoreClient.java

public DatastoreClient(String baseUrl) {
    // Strip to prevent URLs like /storage//internal that won't work.
    this.baseUrl = StringUtils.stripEnd(baseUrl, "/");
}

From source file:au.org.ala.delta.directives.args.TextArgParser.java

@Override
public void parse() throws ParseException {
    _args = new DirectiveArguments();

    String text = readFully();/*from w  w w .j av  a  2 s .co m*/
    text = StringUtils.stripEnd(text, null);
    _args.addTextArgument(text);
}

From source file:com.mg.framework.support.orm.FirebirdStringType.java

@Override
public Object get(ResultSet rs, String name) throws SQLException {
    String result = (String) super.get(rs, name);
    return result == null ? null : StringUtils.stripEnd(result, null);
}

From source file:com.hs.mail.imap.dao.FlagUtils.java

@SuppressWarnings("unchecked")
static String buildParams(Flags.Flag[] flags, boolean replace, boolean set, List params) {
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < flagArray.length; i++) {
        boolean contains = ArrayUtils.contains(flags, flagArray[i]);
        if (contains || replace) {
            sb.append(attrArray[i]).append("= ?,");
            params.add(replace ? (contains ? "Y" : "N") : (set ? "Y" : "N"));
        }/*from   w  ww . j a  v  a2  s  .com*/
    }
    return StringUtils.stripEnd(sb.toString(), ",");
}