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

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

Introduction

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

Prototype

public static String join(Collection<?> collection, String separator) 

Source Link

Document

Joins the elements of the provided Collection into a single String containing the provided elements.

Usage

From source file:com.liferay.jenkins.tools.ConsoleContainsMatcher.java

public ConsoleContainsMatcher(StringGetter stringGetter, String[] match) {
    this(stringGetter, StringUtils.join(match, ' '));
}

From source file:edu.scripps.fl.pubchem.web.entrez.ELinkWebSession.java

public static ELinkWebSession newInstance(String dbFrom, String db, List<String> linkNames, List<Long> ids,
        String term) throws Exception {
    ELinkWebSession session = new ELinkWebSession();
    session.setDbFrom(dbFrom);//from   w w w  .  j a  v  a  2s  .co m
    session.setDb(db);
    session.setLinkName(StringUtils.join(linkNames, ","));
    session.setIds(ids);
    session.setTerm(term);
    return session;
}

From source file:edu.uchicago.mpcs.CrimeTopology.CrimeTopology.java

public static void main(String[] args)
        throws AlreadyAliveException, InvalidTopologyException, AuthorizationException {
    Map stormConf = Utils.readStormConfig();
    String zookeepers = StringUtils.join((List<String>) (stormConf.get("storm.zookeeper.servers")), ",");
    System.out.println(zookeepers);
    ZkHosts zkHosts = new ZkHosts(zookeepers);

    SpoutConfig kafkaConfig = new SpoutConfig(zkHosts, "siruif-crime", "/siruif-crime", "crime_id");
    kafkaConfig.scheme = new SchemeAsMultiScheme(new StringScheme());
    kafkaConfig.zkServers = (List<String>) stormConf.get("storm.zookeeper.servers");
    kafkaConfig.zkRoot = "/siruif-crime";
    kafkaConfig.zkPort = 2181;/* w ww .ja  va2  s  .c  o m*/
    KafkaSpout kafkaSpout = new KafkaSpout(kafkaConfig);

    TopologyBuilder builder = new TopologyBuilder();

    builder.setSpout("raw-siruif-crime", kafkaSpout, 1);
    builder.setBolt("filter-siruif-crime", new FilterCrimeBolt(), 1).shuffleGrouping("raw-siruif-crime");
    builder.setBolt("extract-siruif-ward", new UpdateCrimeBolt(), 1).fieldsGrouping("filter-siruif-crime",
            new Fields("ward"));

    Map conf = new HashMap();
    conf.put(backtype.storm.Config.TOPOLOGY_WORKERS, 2);

    if (args != null && args.length > 0) {
        StormSubmitter.submitTopology(args[0], conf, builder.createTopology());
    } else {
        conf.put(backtype.storm.Config.TOPOLOGY_DEBUG, true);
        LocalCluster cluster = new LocalCluster(zookeepers, 2181L);
        cluster.submitTopology("siruif-crime-topology", conf, builder.createTopology());
    }
}

From source file:net.mikaboshi.intra_mart.tools.log_stats.ant.LogLayoutDataType.java

public String getLayout() {

    return StringUtils.join(this.textList, "").trim();
}

From source file:info.archinnov.achilles.internal.metadata.parsing.EntityExplorer.java

public List<Class<?>> discoverEntities(List<String> packageNames) {
    log.debug("Discovery of Achilles entity classes in packages {}", StringUtils.join(packageNames, ","));

    Set<Class<?>> candidateClasses = new HashSet<Class<?>>();
    Reflections reflections = new Reflections(packageNames);
    candidateClasses.addAll(reflections.getTypesAnnotatedWith(Entity.class));
    return new ArrayList<Class<?>>(candidateClasses);
}

From source file:au.org.ala.bhl.service.WebServiceHelper.java

/**
 * Performs a GET on the specified URI, and expects that the output is well formed JSON. The output is parsed into a JsonNode for consumption
 * /*from w  ww .  j  a v  a  2 s.c  o  m*/
 * @param uri
 * @return
 * @throws IOException
 */
public static JsonNode getJSON(String uri) throws IOException {
    HttpClient httpclient = new DefaultHttpClient();
    HttpGet httpget = new HttpGet(uri);
    httpget.setHeader("Accept", "application/json");
    HttpResponse response = httpclient.execute(httpget);
    HttpEntity entity = response.getEntity();
    if (entity != null) {
        InputStream instream = entity.getContent();
        @SuppressWarnings("unchecked")
        List<String> lines = IOUtils.readLines(instream, "utf-8");
        String text = StringUtils.join(lines, "\n");
        try {
            JsonNode root = new ObjectMapper().readValue(text, JsonNode.class);
            return root;
        } catch (Exception ex) {
            log("Error parsing results for request: %s\n%s\n", uri, text);
            ex.printStackTrace();
        }

    }
    return null;
}

From source file:jp.primecloud.auto.sdk.client.component.StartComponent.java

public void execute(Long componentNo, List<Long> instanceNos) {
    Map<String, String> parameters = new LinkedHashMap<String, String>();
    parameters.put("ComponentNo", componentNo.toString());
    parameters.put("InstanceNos", StringUtils.join(instanceNos, ","));

    requester.execute("/StartComponent", parameters);
}

From source file:com.thoughtworks.go.buildsession.ConsoleCapture.java

public String captured() {
    return StringUtils.join(captured, "\n");
}

From source file:de.tudarmstadt.ukp.dkpro.tc.core.feature.InstanceIdFeature.java

public static Feature retrieve(JCas jcas, TextClassificationUnit unit, Integer sequenceId) {
    String fullId = DocumentMetaData.get(jcas).getDocumentId();
    String[] parts = fullId.split("_");
    fullId = StringUtils.join(Arrays.copyOfRange(parts, 0, parts.length - 1), "_");

    fullId = fullId + "_" + sequenceId;
    fullId = fullId + "_" + unit.getId();

    String suffix = unit.getSuffix();
    if (suffix != null && suffix.length() > 0) {
        fullId = fullId + "_" + suffix;
    }/*w w  w.  j  av  a2s .  co m*/

    return new Feature(ID_FEATURE_NAME, fullId);
}

From source file:com.apress.prospringintegration.messagestore.util.MessageGroupStoreActivator.java

@ServiceActivator
public void handleMessages(Message<Collection<Object>> msg) throws Throwable {
    Collection<Object> payloads = msg.getPayload();

    System.out.println("-------------------------------------------");
    System.out.println(StringUtils.join(payloads, ", "));
}