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:eu.eidas.auth.commons.PersonalAttribute.java

/**
 * Guesses the friendly name from the given full attribute name URI.
 *
 * @param name the attribute name URI/*from w ww . j a  v a 2  s. c  om*/
 * @return the guessed friendly name
 */
public static String extractFriendlyName(@Nonnull String name) {
    Preconditions.checkNotNull(name, "name");
    if (StringUtils.isBlank(name)) {
        return StringUtils.EMPTY;
    }
    int lastIndexOf = name.lastIndexOf('/');
    if (lastIndexOf == -1 || lastIndexOf == name.length() - 1) {
        return name;
    }
    return name.substring(lastIndexOf + 1);
}

From source file:com.fengduo.bee.commons.result.JsonResultUtils.java

public static String getSubmitedJson(String data) {
    String submitedJson = StringUtils.EMPTY;
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("result", ResultCode.SUBMITED.getValue());
    params.put("message", getMessage(ResultCode.SUBMITED, null));
    params.put("data", StringUtils.isNotEmpty(data) ? data : StringUtils.EMPTY);
    try {//w w  w . ja  v  a 2s .  c  o  m
        submitedJson = new Gson().toJson(params);
    } catch (Exception e) {

    }
    return submitedJson;
}

From source file:com.amalto.core.metadata.ClassRepository.java

public ClassRepository() {
    // Create a type for MAPs
    ComplexTypeMetadata internalMapType = new ComplexTypeMetadataImpl(getUserNamespace(), MAP_TYPE_NAME, false);
    SimpleTypeMetadata embeddedXml = new SimpleTypeMetadata(StringUtils.EMPTY, EMBEDDED_XML);
    embeddedXml.addSuperType(STRING);/*from w  w w.ja va2s.c  om*/
    embeddedXml.setData(MetadataRepository.DATA_MAX_LENGTH, String.valueOf(Integer.MAX_VALUE));
    internalMapType.addField(new SimpleTypeFieldMetadata(internalMapType, false, false, false, "key", STRING, //$NON-NLS-1$
            Collections.<String>emptyList(), Collections.<String>emptyList(), Collections.<String>emptyList(),
            StringUtils.EMPTY));
    internalMapType.addField(new SimpleTypeFieldMetadata(internalMapType, false, false, false, "value", //$NON-NLS-1$
            embeddedXml, Collections.<String>emptyList(), Collections.<String>emptyList(),
            Collections.<String>emptyList(), StringUtils.EMPTY));
    MAP_TYPE = (ComplexTypeMetadata) internalMapType.freeze();
    addTypeMetadata(MAP_TYPE);
    // Register known subclasses
    registeredSubClasses.put(IWhereItem.class, Arrays.<Class>asList(CustomWhereCondition.class, WhereAnd.class,
            WhereCondition.class, WhereLogicOperator.class, WhereOr.class));
}

From source file:jenkins.plugins.coverity.CoverityTool.CovBuildCompileCommandTest.java

@Test
public void commandForCompileSourcesTest_WithAdditionalBuildArguments()
        throws IOException, InterruptedException {
    InvocationAssistance invocationAssistance = new InvocationAssistanceBuilder()
            .withBuildArguments("AdditionalBuildArguments").build();
    CoverityPublisher publisher = new CoverityPublisherBuilder().withInvocationAssistance(invocationAssistance)
            .build();/*w ww  .j av  a  2s. c om*/

    Command covBuildCommand = new CovBuildCompileCommand(build, launcher, listener, publisher,
            StringUtils.EMPTY, envVars);
    setExpectedArguments(new String[] { "cov-build", "--dir", "$COV_IDIR", "AdditionalBuildArguments" });
    covBuildCommand.runCommand();
    consoleLogger.verifyLastMessage(
            "[Coverity] cov-build command line arguments for compiled sources: " + actualArguments.toString());
}

From source file:com.iyonger.apm.web.util.HttpContainerContext.java

/**
 * Get current container nGrinder context base path.
 * <p/>/*from w  w w  .  j  ava  2s.co  m*/
 * E.g) if user requests http://hostname:port/context_path/realurl, This
 * will return http://hostname:port/context_path
 * <p/>
 * In case of providing "http.url" property in system.properties file, this
 * method will return pre-set value.
 *
 * @return ngrinder context base path on http request.
 */
public String getCurrentContextUrlFromUserRequest() {
    String httpUrl = StringUtils.trimToEmpty(config.getControllerProperties().getProperty(PROP_CONTROLLER_URL));
    // if provided
    if (StringUtils.isNotBlank(httpUrl)) {
        return httpUrl;
    }

    // if empty
    SecurityContextHolderAwareRequestWrapper request = cast(
            RequestContextHolder.currentRequestAttributes().resolveReference("request"));
    int serverPort = request.getServerPort();
    // If it's http default port it will ignore the port part.
    // However, if ngrinder is provided in HTTPS.. it can be a problem.
    // FIXME : Later fix above.
    String portString = (serverPort == DEFAULT_WEB_PORT) ? StringUtils.EMPTY : ":" + serverPort;
    return httpUrl + request.getScheme() + "://" + request.getServerName() + portString
            + request.getContextPath();
}

From source file:fr.paris.lutece.plugins.workflow.service.taskinfo.TaskInfoManager.java

/**
 * Get the task resource info. This method will first get
 * the appropriate provider from the given id task.
 * @param nIdHistory the id history/*from  ww  w  .  j a v a  2s. c  o  m*/
 * @param nIdTask the id task
 * @param request the HTTP request
 * @return the task resource info
 */
public static String getTaskResourceInfo(int nIdHistory, int nIdTask, HttpServletRequest request) {
    String strInfo = StringUtils.EMPTY;
    Locale locale = getLocale(request);
    ITaskService taskService = SpringContextService.getBean(TaskService.BEAN_SERVICE);
    ITask task = taskService.findByPrimaryKey(nIdTask, locale);

    if (task != null) {
        ITaskInfoProvider provider = getProvider(task.getTaskType().getKey());

        if (provider != null) {
            strInfo = provider.getTaskResourceInfo(nIdHistory, nIdTask, request);
        }
    }

    return strInfo;
}

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

public static String revertNotNormalString(String text) {

    if (StringUtils.isBlank(text)) {
        return StringUtils.EMPTY;
    }//from  w  w  w .  j  av  a2 s  . co  m

    return StringUtils.replaceEach(text, new String[] { "&amp;", "&lt;", "&gt;", "&quot;", "\\\\", "&quot;" },
            new String[] { "&", "<", ">", "\"", "\\", "\'" });
}

From source file:com.aionemu.gameserver.model.gameobjects.SummonedObject.java

@Override
public String getMasterName() {
    return creator != null ? creator.getName() : StringUtils.EMPTY;
}

From source file:com.ctrip.api.CtripApiTemplate.java

@Override
public SoapResponse send(String uri, SoapRequest soapRequest) {
    // requestResult
    StringResult requestResult = new StringResult();
    jaxb2Marshaller.marshal(soapRequest, requestResult);
    String requestContent = requestResult.toString();
    log.debug("requestContent - " + requestContent);
    // responseResult
    StringResult responseResult = new StringResult();
    webServiceTemplate.sendSourceAndReceiveToResult(uri, new StringSource(requestContent),
            new SoapActionCallback(SOAP_ACTION), responseResult);
    String responseContent = responseResult.toString();
    log.debug("responseContent - " + responseContent);
    // delete responseContent xmlns, fixed unmarshal bugs.
    responseContent = StringUtils.replace(responseContent, CtripApiTemplate.SOAP_RESPONSE_NS,
            StringUtils.EMPTY);
    return (SoapResponse) jaxb2Marshaller.unmarshal(new StringSource(responseContent));
}

From source file:com.chadekin.jadys.commons.expression.SqlExpressionBuilderFactoryTest.java

@Test
public void shouldNotBuildExpressionClauseWhenValueIsNull() {
    // Arrange// w  w  w .  j a  v a 2 s.c  om
    SqlExpressionFactory localBuilder = SqlExpressionFactory.newExpression("name", JadysSqlOperation.NOT_EQUAL,
            null);

    // Act
    String sql = localBuilder.build();

    // Assert
    assertThat(sql, is(StringUtils.EMPTY));
}