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

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

Introduction

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

Prototype

String EMPTY

To view the source code for org.apache.commons.lang StringUtils EMPTY.

Click Source Link

Document

The empty String "".

Usage

From source file:com.apexxs.neonblack.utilities.TikaTextExtractor.java

public String extractTextFromInputStream(InputStream is) {
    String text = StringUtils.EMPTY;

    try {/*from w w w . j av a2  s  . co  m*/
        BodyContentHandler contentHandler = new BodyContentHandler();
        Metadata metadata = new Metadata();
        Parser parser = new AutoDetectParser();
        parser.parse(is, contentHandler, metadata, new ParseContext());
        text = contentHandler.toString();
    } catch (Exception ex) {
        logger.error("Error in TikaTextExtractor.extractFromInputStream(): " + ex.getMessage());
    }
    return text;
}

From source file:com.careerly.utils.TextUtils.java

/**
 * xssjavascript//from w w w .j ava2 s .  co  m
 *
 * @param text ??
 * @return ??
 */
public static String escapeJavaScript(String text) {
    return StringUtils.isBlank(text) ? StringUtils.EMPTY : StringEscapeUtils.escapeJavaScript(text);
}

From source file:com.adobe.cq.wcm.core.components.testing.MockContentPolicyMapping.java

@Override
public ContentPolicy getPolicy() {
    ValueMap valueMap = contentPolicyResource.adaptTo(ValueMap.class);
    if (valueMap.containsKey("cq:policy")) {
        String policyPath = valueMap.get("cq:policy", StringUtils.EMPTY);
        if (StringUtils.isNotEmpty(policyPath)) {
            policyPath = "/conf/coretest/settings/wcm/policies/" + policyPath;
            Resource policyResource = contentPolicyResource.getResourceResolver().getResource(policyPath);
            if (policyResource != null) {
                return new MockContentPolicy(policyResource);
            }//w ww.j a  v  a  2 s.c  o  m
        }
    }
    return null;
}

From source file:info.magnolia.cms.gui.inline.BarNew.java

public void setButtonNew() {
    this.setButtonNew(this.getPath(), this.getNodeCollectionName(StringUtils.EMPTY),
            this.getNodeName(StringUtils.EMPTY), this.getParagraph());
}

From source file:gobblin.aws.GobblinAWSUtils.java

private static String getClasspathFromPath(File path) {
    if (null == path) {
        return StringUtils.EMPTY;
    }//from  ww w .  j  a  v  a 2s .  co  m
    if (!path.isDirectory()) {
        return path.getAbsolutePath();
    }

    return Joiner.on(":").skipNulls().join(path.list(FileFileFilter.FILE));
}

From source file:com.chadekin.jadys.commons.expression.impl.AlphaExpressionBuilder.java

@Override
public String build() {
    if (value == null || StringUtils.isBlank(value.toString())) {
        return StringUtils.EMPTY;
    }//from   ww  w .ja  v  a  2s  . c om
    StringBuilder result = new StringBuilder(JadysKeys.SPACE).append(operator.getOperator())
            .append(JadysKeys.SPACE).append(value);
    return result.toString();
}

From source file:com.envision.envservice.common.util.SAPUtil.java

/**
 * To Field Display// ww  w  . j a  va2 s.  co m
 */
public static String toFieldDisplay(String sapInfo) {
    if (StringUtils.isEmpty(sapInfo)) {
        return StringUtils.EMPTY;
    }

    if (!sapInfo.contains(MARK_SPACE)) {
        return sapInfo;
    }

    return sapInfo.substring(0, sapInfo.lastIndexOf(FIELD_PREFIX_CODE) - 1);
}

From source file:info.magnolia.templating.freemarker.ReadOnlyComponentDirectiveTest.java

@Test
public void testRenderComponentWithoutComment() throws Exception {
    // WHEN/*from   www.  j av  a  2  s . c  om*/
    String result = renderForTest(
            "[@cms.component workspace=\"testWorkspace\" path=\"/foo/bar/paragraphs/1\" /]", null);
    // THEN
    assertEquals(StringUtils.EMPTY, result);
}

From source file:net.sourceforge.ajaxtags.helpers.HTMLDivElementTest.java

/**
 * Test method for/*from w  ww . jav  a2  s . c o m*/
 * {@link net.sourceforge.ajaxtags.helpers.AbstractHTMLElement#setClassName(java.lang.String)}.
 */
@Test
public void testSetClassName() {
    div.setClassName("class1");
    assertEquals("Empty div with class", "<div class=\"class1\"></div>", div.toString());
    div.setClassName(StringUtils.EMPTY);
    assertEquals("Empty div without class", EMPTY_DIV, div.toString());
    div.setClassName("class1 class2");
    assertEquals("Empty div with classes", "<div class=\"class1 class2\"></div>", div.toString());
    div.setClassName(null);
    assertEquals("Empty div without class", EMPTY_DIV, div.toString());
}

From source file:com.envision.envservice.rest.AssessmentCyclesResource.java

@GET
@Path("/addAssessmentCycles")
@Produces(MediaType.APPLICATION_JSON)/*from   w ww  . ja va2 s . c om*/
public Response addAssessmentCycles() throws Exception {
    HttpStatus status = HttpStatus.CREATED;
    String response = StringUtils.EMPTY;
    response = acService.addAssessmentCycles().toString();
    return Response.status(status.value()).entity(response).build();

}