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:edu.ucla.cs.scai.linkedspending.index.Utils.java

public static String normalizeWords(String w) {
    w = w.replaceAll("[^A-Za-z0-9']", " ");
    //separate camel case words
    if (!w.contains(" ")) {
        w = StringUtils.join(StringUtils.splitByCharacterTypeCamelCase(w), ' ');
    }/*from   w ww .j  a  v  a  2s  . c om*/
    //collapse multiple spaces
    w = w.replaceAll("\\s+", " ");
    //change to lower case
    w = w.toLowerCase();
    return w;
}

From source file:name.martingeisse.ecobuild.moduletool.eco32.EosApplicationTool.java

@Override
protected void onModuleOutdated(IModuleToolContext context) throws IOException {

    File moduleSourceFolder = context.getModuleSourceFolder();
    File moduleBuildFolder = context.getModuleBuildFolder();
    AbstractLogger logger = context.getLogger();

    String executableName = getOutputFileName(context);
    String executablePath = moduleBuildFolder.getCanonicalPath() + "/" + executableName;
    String mapFilePath = EcobuildFileUtil.replaceFilenameExtension(executablePath, ".bin", ".map");

    String sourceFiles = StringUtils.join(moduleSourceFolder.list(new SuffixFileFilter(".c")), ' ');
    String command = LccInvocation.getLccCommand(context) + " -A -Wl-m $-Wl" + mapFilePath + "$ -o $"
            + moduleBuildFolder.getCanonicalPath() + "/" + executableName + "$ " + sourceFiles;
    new LccInvocation(context, moduleSourceFolder, command, logger).invoke();

}

From source file:com.xhsoft.framework.common.exception.BaseRuntimeException.java

/**
 * <p>Description:getMessage</p>
 * @return String//  w  w w.j  av  a2  s  .  c  om
 * @author wenzhi
 * @version 1.0
 */
public String getMessage() {
    if (code == null || code.length() == 0) {
        return super.getMessage();
    }
    String i18n = "";
    if (StringUtils.isNotEmpty(i18n)) {
        return i18n;
    }
    String paramsStr = "NA";
    if (params != null) {
        paramsStr = StringUtils.join(params, ",");
    }
    String codeMessage = "code:" + code + ";parameters:" + paramsStr;
    return codeMessage;
}

From source file:com.sap.prd.mobile.ios.mios.RemoveTrailingCharactersVersionTransformer.java

public String transform(String version) throws NumberFormatException {

    final String originalVersion = version;

    if (version == null)
        throw new NullPointerException("Version was null.");

    String[] parts = version.split("\\.");

    List<String> result = new ArrayList<String>();

    int length = (limit == -1 ? parts.length : Math.min(parts.length, limit));

    for (int i = 0; i < length; i++) {

        String part = removeTrailingNonNumbers(parts[i]);

        if (part.trim().isEmpty())
            part = "0";

        if (Long.parseLong(part) < 0) {
            throw new NumberFormatException("Invalid version found: '" + originalVersion
                    + "'. Negativ version part found: " + parts[i] + ".");
        }//from  w  w  w.  j  ava 2s. co  m

        result.add(part);

        if (!parts[i].matches("\\d+"))
            break;

    }

    while (result.size() < limit)
        result.add("0");

    return StringUtils.join(result, '.');
}

From source file:com.baidu.rigel.biplatform.tesseract.qsservice.query.vo.GroupBy.java

@Override
public String toString() {
    return StringUtils.join(groups, ",");
}

From source file:com.github.restdriver.serverdriver.matchers.HasHeader.java

@Override
protected void describeMismatchSafely(Response response, Description mismatchDescription) {
    List<Header> headers = response.getHeaders();

    if (headers.isEmpty()) {
        mismatchDescription.appendText("Response has no headers");
    } else {/*from   w ww  .  j ava  2  s  .c  om*/
        mismatchDescription
                .appendText("Response has headers [" + StringUtils.join(response.getHeaders(), ", ") + "]");
    }
}

From source file:io.viewserver.execution.nodes.IndexNode.java

@Override
protected String getConfigForOperatorName(ParameterHelper parameterHelper) {
    return String.format("index:%s", StringUtils.join(indexedColumns, ','));
}

From source file:com.alta189.bukkitplug.command.CommonCommand.java

public void setPermissions(String[] permissions) {
    this.permissions = permissions;
    if (permissions != null) {
        super.setPermission(StringUtils.join(permissions, ";"));
    }// w w w . j a va2  s. c  o  m
}

From source file:edu.vt.vbi.patric.jbrowse.CRTrack.java

public String getSeedIds() {

    return StringUtils.join(SeedIds, " OR ");
}

From source file:au.org.ala.delta.intkey.ui.DirectiveAction.java

@Override
public void actionPerformed(ActionEvent e) {
    try {/*from  ww  w . j  av  a2s  .  co m*/
        _directive.parseAndProcess(_context, null);
    } catch (IntkeyDirectiveParseException ex) {
        ex.printStackTrace();
        String msg = ex.getMessage();
        JOptionPane.showMessageDialog(UIUtils.getMainFrame(), msg, "Error", JOptionPane.ERROR_MESSAGE);
        Logger.error(msg);
    } catch (Exception ex) {
        ex.printStackTrace();
        String msg = MessageFormat.format(UIUtils.getResourceString("ErrorWhileProcessingCommand.error"),
                StringUtils.join(_directive.getControlWords(), " ").toUpperCase(), ex.getMessage());
        JOptionPane.showMessageDialog(UIUtils.getMainFrame(), msg, "Error", JOptionPane.ERROR_MESSAGE);
        Logger.error(msg);
        Logger.error(ex);
    }
}