Example usage for org.springframework.util StringUtils replace

List of usage examples for org.springframework.util StringUtils replace

Introduction

In this page you can find the example usage for org.springframework.util StringUtils replace.

Prototype

public static String replace(String inString, String oldPattern, @Nullable String newPattern) 

Source Link

Document

Replace all occurrences of a substring within a string with another string.

Usage

From source file:eu.europeana.corelib.edm.utils.construct.ProvidedChoSolrCreator.java

public void create(SolrInputDocument doc, ProvidedCHOImpl pCho) {
    SolrUtils.addFromString(doc, EdmLabel.EUROPEANA_ID, StringUtils.replace(pCho.getAbout(), "/item/", "/"));
    SolrUtils.addFromStringArray(doc, EdmLabel.PROXY_OWL_SAMEAS, pCho.getOwlSameAs());
}

From source file:uk.ac.gda.util.SimpleFilePathConverter.java

@Override
public String converttoInternal(String filepath) {
    return StringUtils.replace(filepath, userSubString, internalSubString);
}

From source file:org.arrow.data.neo4j.query.cypher.close.SimpleClose.java

public SimpleClose(String cypher) {
    Assert.notNull(cypher);/*from ww w  .j  a v a  2s .  c  o  m*/

    cypher = StringUtils.replace(cypher, "return", "");
    cypher = StringUtils.trimWhitespace(cypher);

    this.cypher = cypher;
}

From source file:org.arrow.data.neo4j.query.cypher.match.SimpleMatch.java

public SimpleMatch(String cypher) {
    Assert.notNull(cypher);//  w  w w .j  av a  2s.  c o  m

    cypher = StringUtils.replace(cypher, "match", "");
    cypher = StringUtils.trimWhitespace(cypher);

    this.cypher = cypher;
}

From source file:org.arrow.data.neo4j.query.cypher.start.SimpleStart.java

public SimpleStart(String cypher) {
    Assert.notNull(cypher);/*from ww w  . j a va 2  s.  c  om*/

    cypher = StringUtils.replace(cypher, "start", "");
    cypher = StringUtils.trimWhitespace(cypher);

    this.cypher = cypher;
}

From source file:org.arrow.data.neo4j.query.cypher.where.SimpleWhere.java

public SimpleWhere(String cypher) {
    Assert.notNull(cypher);//from  w  w  w. j  a v a  2 s.  c  o  m

    cypher = StringUtils.replace(cypher, "where", "");
    cypher = StringUtils.trimWhitespace(cypher);

    this.cypher = cypher;
}

From source file:uk.ac.gda.util.UnixToWindowsFilePathConverter.java

@Override
public String converttoInternal(String filepath) {

    String replace = StringUtils.replace(filepath, unixSubString, windowsSubString);
    if (backSlash)
        replace = StringUtils.replace(replace, "/", "\\");
    return replace;
}

From source file:org.yamj.common.type.ExitType.java

/**
 * Get an output string of the exit values
 *
 * @return/*w w  w. j  a  va  2 s  . c  o  m*/
 */
public static String getDescriptions() {
    final StringBuilder sb = new StringBuilder("Exit codes: \n");

    for (ExitType et : ExitType.values()) {
        sb.append("    ");
        sb.append(et.getReturn());
        sb.append(" = ");
        sb.append(StringUtils.capitalize(StringUtils.replace(et.toString(), "_", " ").toLowerCase()));
        sb.append("\n");
    }

    return sb.toString();
}

From source file:uk.ac.gda.util.SimpleFilePathConverter.java

@Override
public String converttoExternal(String filepath) {
    return StringUtils.replace(filepath, internalSubString, userSubString);
}

From source file:uk.ac.gda.util.UnixToWindowsFilePathConverter.java

@Override
public String converttoExternal(String filepath) {
    String replace = StringUtils.replace(filepath, windowsSubString, unixSubString);
    if (backSlash)
        replace = StringUtils.replace(replace, "\\", "/");
    return replace;
}