List of usage examples for org.apache.commons.lang StringUtils chomp
public static String chomp(String str, String separator)
Removes separator
from the end of str
if it's there, otherwise leave it alone.
From source file:com.linkedin.pinot.controller.helix.ControllerRequestURLBuilder.java
public String forInstanceBulkCreate() { return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "instances", "bulkAdd"); }
From source file:com.linkedin.pinot.controller.helix.ControllerRequestURLBuilder.java
public String forTenantCreate() { return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tenants/"); }
From source file:com.linkedin.pinot.core.realtime.impl.kafka.KafkaAvroMessageDecoder.java
@Override public void init(Map<String, String> props, Schema indexingSchema, String topicName) throws Exception { schemaRegistryBaseUrl = props.get(SCHEMA_REGISTRY_REST_URL); StringUtils.chomp(schemaRegistryBaseUrl, "/"); kafkaTopicName = topicName;//from w w w. ja va2 s . c o m String avroSchemaName = kafkaTopicName; if (props.containsKey(SCHEMA_REGISTRY_SCHEMA_NAME) && props.get(SCHEMA_REGISTRY_SCHEMA_NAME) != null && !props.get(SCHEMA_REGISTRY_SCHEMA_NAME).isEmpty()) { avroSchemaName = props.get(SCHEMA_REGISTRY_SCHEMA_NAME); } defaultAvroSchema = fetchSchema(new URL(schemaRegistryBaseUrl + "/latest_with_type=" + avroSchemaName)); this.avroRecordConvetrer = new AvroRecordToPinotRowGenerator(indexingSchema); this.decoderFactory = new DecoderFactory(); md5ToAvroSchemaMap = new HashMap<String, org.apache.avro.Schema>(); }
From source file:com.linkedin.pinot.controller.helix.ControllerRequestURLBuilder.java
public String forBrokerTenantCreate() { return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tenants?type=broker"); }
From source file:biz.netcentric.cq.tools.actool.helper.AceBean.java
public String getActionsString() { if (this.actions != null) { StringBuilder sb = new StringBuilder(); for (String action : this.actions) { sb.append(action).append(","); }/*from www. ja va 2s . com*/ return StringUtils.chomp(sb.toString(), ","); } return ""; }
From source file:com.egt.ejb.toolkit.ToolKitUtils.java
public static String mkLibSrcDir(String root, String project, String subproject) { String sep = System.getProperties().getProperty("file.separator"); String com = PREFIJO_PAQUETE.replace(".", sep); String lib = getLibPackageName(project).replace(".", sep); String sub = StringUtils.isBlank(subproject) ? "" : sep + subproject.replace("-", sep).replace(".", sep); String dir = StringUtils.chomp(root, sep) + sep + project + sep + "src" + sep + com + sep + lib + sub; mkdirs(dir);//from ww w .j a v a 2s .co m return dir + sep; }
From source file:com.linkedin.pinot.controller.helix.ControllerRequestURLBuilder.java
public String forServerTenantCreate() { return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tenants?type=server"); }
From source file:com.hs.mail.imap.processor.AbstractListProcessor.java
private void doProcess(ImapSession session, AbstractListRequest request, ListResponder responder) { String referenceName = request.getMailbox(); String mailboxName = request.getPattern(); if (StringUtils.isEmpty(mailboxName)) { // An empty mailbox name argument is a special request // to return the hierarchy delimiter and the root name of the name // given in the reference. String referenceRoot = ""; if (referenceName.startsWith(ImapConstants.NAMESPACE_PREFIX)) { // A qualified reference name - get the first element. int i = referenceName.indexOf(Mailbox.folderSeparator); if (i != -1) { referenceRoot = referenceName.substring(0, i + 1); }//from www . j a v a 2 s. co m } responder.untagged(request.getCommand() + " (\\Noselect) \"" + Mailbox.folderSeparator + "\" \"" + referenceRoot + "\"\r\n"); } else { if (mailboxName.startsWith(ImapConstants.NAMESPACE_PREFIX)) { // If the mailboxName if fully qualified, ignore the reference // name. referenceName = ""; } else { // Remove separator from the end of reference name. referenceName = StringUtils.chomp(referenceName, Mailbox.folderSeparator); } doList(session, responder, referenceName, mailboxName); } responder.okCompleted(request); }
From source file:com.linkedin.pinot.controller.helix.ControllerRequestURLBuilder.java
public String forTenantCreate(String tenantName) { return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tenants", tenantName, "instances"); }
From source file:com.linkedin.pinot.controller.helix.ControllerRequestURLBuilder.java
public String forServerTenantCreate(String tenantName) { return StringUtil.join("/", StringUtils.chomp(_baseUrl, "/"), "tenants", tenantName, "instances?type=server"); }