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

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

Introduction

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

Prototype

public static String chomp(String str, String separator) 

Source Link

Document

Removes separator from the end of str if it's there, otherwise leave it alone.

Usage

From source file:StringUtilsExampleV1.java

public static void main(String args[]) {

    System.err.println(StringUtils.chomp("temperature", "ure"));
}

From source file:MainClass.java

public static void main(String[] args) {

    //Remove the specified string at the end of String
    System.out.println("3) Chomp END >>>" + StringUtils.chomp("A test String END", "END"));

}

From source file:StringUtilsTrial.java

public static void main(String[] args) {

    // Remove the specified string at the end of String
    System.out.println("3) Chomp END >>>" + StringUtils.chomp("A test String END", "END"));

}

From source file:com.rslakra.java.string.TestApacheStringUtils.java

public static void main(String args[]) {

    System.err.println(StringUtils.abbreviate("Take time off working", 0, 10));
    System.err.println(StringUtils.capitalize("vanderLust"));
    System.err.println(StringUtils.center("MTV", 7, '='));
    System.err.println(StringUtils.chomp("temperature", "ure"));
    System.err.println(StringUtils.chop("Dane"));
    System.err.println(StringUtils.contains("Dorothy", "oro"));
    System.err.println(StringUtils.containsNone("r u m t", new char[] { 'r', 'o' }));
    System.err.println(StringUtils.containsOnly("r u m t", new char[] { 'r', 'o' }));
    System.err.println(StringUtils.countMatches("arthur", "r"));
    System.err.println(StringUtils.deleteWhitespace("f f f f"));
    System.err.println(StringUtils.difference("govern", "government"));
    System.err.println(StringUtils.getLevenshteinDistance("govern", "government"));

}

From source file:com.linkedin.pinot.controller.helix.starter.HelixConfig.java

public static String getAbsoluteZkPathForHelix(String zkBaseUrl) {
    zkBaseUrl = StringUtils.chomp(zkBaseUrl, "/");
    return zkBaseUrl;
}

From source file:com.linkedin.pinot.controller.helix.ControllerRequestURLBuilder.java

public String forResourceCreate() {
    return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "dataresources");
}

From source file:com.linkedin.pinot.controller.helix.ControllerRequestURLBuilder.java

public String forResourceDelete(String resourceName) {
    return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "dataresources", resourceName);
}

From source file:com.hs.mail.imap.processor.CreateProcessor.java

@Override
protected void doProcess(ImapSession session, ImapRequest message, Responder responder) {
    CreateRequest request = (CreateRequest) message;
    String mailboxName = request.getMailbox();
    mailboxName = StringUtils.chomp(mailboxName, Mailbox.folderSeparator);
    if (ImapConstants.INBOX_NAME.equalsIgnoreCase(mailboxName)) {
        responder.taggedNo(request, HumanReadableText.FAILED_TO_CREATE_INBOX);
    } else {//  w ww .j a  v  a  2  s  .  co m
        MailboxManager manager = getMailboxManager();
        if (manager.mailboxExists(session.getUserID(), mailboxName)) {
            responder.taggedNo(request, HumanReadableText.MAILBOX_EXISTS);
        } else if (mailboxName.startsWith(ImapConstants.NAMESPACE_PREFIX)) {
            // Thunderbird 3.1
            responder.taggedNo(request, HumanReadableText.NAMESPACE_NOT_EXIST);
        } else {
            // TODO Check for \Noinferiors flag
            manager.createMailbox(session.getUserID(), mailboxName);
            responder.okCompleted(request);
        }
    }
}

From source file:com.linkedin.pinot.controller.helix.ControllerRequestURLBuilder.java

public String forResourceGet(String resourceName) {
    return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "dataresources", resourceName);
}

From source file:com.linkedin.pinot.controller.helix.ControllerRequestURLBuilder.java

public String forDataFileUpload() {
    return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "segments");
}