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

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

Introduction

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

Prototype

public static String deleteWhitespace(String str) 

Source Link

Document

Deletes all whitespaces from a String as defined by Character#isWhitespace(char) .

Usage

From source file:org.yawlfoundation.yawl.schema.YSchemaVersion.java

private String toCompactString() {
    return StringUtils.deleteWhitespace(toString());
}

From source file:org.yawlfoundation.yawl.unmarshal.YawlXMLSpecificationValidator.java

private String getSchemaFileName(String version) {
    String versPart = YSpecification.Beta2.equals(version) ? "" : StringUtils.deleteWhitespace(version);
    return String.format("YAWL_Schema%s.xsd", versPart);
}

From source file:rapture.repo.mongodb.MongoDbDataStore.java

@Override
public boolean matches(String key, String value) {
    String val = get(key);
    if (val == null)
        return false;
    String valspc = StringUtils.deleteWhitespace(value);

    try {/*from  ww w. jav  a 2  s.  c  om*/
        return StringUtils.deleteWhitespace(JacksonUtil.jsonFromObject(JacksonUtil.getMapFromJson(val)))
                .equals(valspc);
    } catch (Exception e) {
    }

    return (StringUtils.deleteWhitespace(val).equals(valspc));
}

From source file:rapture.repo.postgres.PostgresDataStore.java

@Override
public boolean matches(String key, String value) {
    if (value != null) {
        String existing = get(key);
        if (existing != null) {
            existing = StringUtils
                    .deleteWhitespace(JacksonUtil.jsonFromObject(JacksonUtil.getMapFromJson(existing)));
            //noinspection ConstantConditions
            return existing.equals(StringUtils.deleteWhitespace(value));
        } else {/*from   w w w .  ja  v a  2  s  .  c o m*/
            return false;
        }
    } else {
        return false;
    }
}

From source file:rapture.repo.RepoTestContract.java

@Test
public void testVersionInfo() {
    String content = Kernel.getDoc().getDoc(ctx, REPO_URI1 + "/1");
    assertEquals(StringUtils.deleteWhitespace(defContent2), StringUtils.deleteWhitespace(content));
}

From source file:rapture.repo.RepoTestContract.java

@Test
public void testGetDocAndMetas() {
    String[] uris = { REPO_URI1 + "/xx1", REPO_URI1 + "/xx2", REPO_URI1 + "/xx3", REPO_URI1 + "/xx4" };
    for (String uri : uris) {
        Kernel.getDoc().putDoc(ctx, uri, defContent);
    }/* w  ww  . ja  v a 2 s  . co  m*/

    List<DocumentWithMeta> dwms = Kernel.getDoc().getDocAndMetas(ctx, Arrays.asList(uris));
    assertEquals(4, dwms.size());
    int i = 1;
    for (DocumentWithMeta dwm : dwms) {
        assertEquals(StringUtils.deleteWhitespace(defContent), StringUtils.deleteWhitespace(dwm.getContent()));
        assertEquals(batchExpectedV1(), dwm.getMetaData().getVersion().intValue());
        assertEquals("xx" + i++, dwm.getDisplayName());
    }

    for (String uri : uris) {
        Kernel.getDoc().putDoc(ctx, uri, defContent2);
    }

    dwms = Kernel.getDoc().getDocAndMetas(ctx, Arrays.asList(uris));
    assertEquals(4, dwms.size());
    i = 1;
    for (DocumentWithMeta dwm : dwms) {
        assertEquals(StringUtils.deleteWhitespace(defContent2), StringUtils.deleteWhitespace(dwm.getContent()));
        assertEquals(batchExpectedV2(), dwm.getMetaData().getVersion().intValue());
        assertEquals("xx" + i++, dwm.getDisplayName());
    }

    for (int j = 0; j < uris.length; j++) {
        uris[j] = uris[j] + "@1";
    }

    dwms = Kernel.getDoc().getDocAndMetas(ctx, Arrays.asList(uris));
    assertEquals(4, dwms.size());
    i = 1;
    for (DocumentWithMeta dwm : dwms) {
        assertEquals(StringUtils.deleteWhitespace(batchExpectedContent()),
                StringUtils.deleteWhitespace(dwm.getContent()));
        assertEquals(batchExpectedV1(), dwm.getMetaData().getVersion().intValue());
        assertEquals("xx" + i++, dwm.getDisplayName());
    }

}

From source file:rapture.repo.VersionedRepoTest.java

@Test
public void testRevert() {
    Kernel.getDoc().revertDoc(ctx, REPO_URI1 + "/1");
    String content = Kernel.getDoc().getDoc(ctx, REPO_URI1 + "/1");
    assertEquals(StringUtils.deleteWhitespace(defContent), StringUtils.deleteWhitespace(content));
}

From source file:rapture.repo.VersionedRepoTest.java

@Test
public void testVersionRequest() {
    String content = Kernel.getDoc().getDoc(ctx, REPO_URI1 + "/1@1");
    assertEquals(StringUtils.deleteWhitespace(defContent), StringUtils.deleteWhitespace(content));
}

From source file:se.altrusoft.docserv.integ.IntegrationTest.java

private String getNonWhiteSpacesFromPDF(byte[] pdfByteArray) throws IOException {
    String nonWhiteSpace;/* w w w. ja v a2 s.  c o m*/

    PdfReader pdfReader = null;
    try {
        pdfReader = new PdfReader(pdfByteArray);
        nonWhiteSpace = StringUtils.deleteWhitespace(PdfTextExtractor.getTextFromPage(pdfReader, 1));
        // remove non-break space
        nonWhiteSpace = nonWhiteSpace.replace("\u00A0", "");
        nonWhiteSpace = nonWhiteSpace.replace("\u00AD", "-");
    } catch (IOException e) {
        throw e;
    } finally {
        if (pdfReader != null) {
            pdfReader.close();
        }
    }

    return nonWhiteSpace;
}

From source file:ubic.gemma.datastructure.matrix.ExpressionDataWriterUtils.java

/**
 * @param bioMaterial//from   w  ww. j av a2s  .c  o  m
 * @param bioAssays
 * @return
 */
public static String constructBioAssayName(BioMaterial bioMaterial, Collection<BioAssay> bioAssays) {
    StringBuffer colBuf = new StringBuffer();
    colBuf.append(bioMaterial.getName() + DELIMITER_BETWEEN_BIOMATERIAL_AND_BIOASSAYS);

    colBuf.append(StringUtils.join(bioAssays, "."));

    String colName = StringUtils.deleteWhitespace(colBuf.toString());

    String rCompatibleColName = constructRCompatibleBioAssayName(colName);

    return rCompatibleColName;
}