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

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

Introduction

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

Prototype

public static boolean isNotBlank(String str) 

Source Link

Document

Checks if a String is not empty (""), not null and not whitespace only.

Usage

From source file:com.green.modules.cms.utils.CmsUtils.java

/**
 * ?/*from w  w w .  ja  v a 2s . co m*/
 * @param siteId ?
 */
public static Site getSite(String siteId) {
    String id = "1";
    if (StringUtils.isNotBlank(siteId)) {
        id = siteId;
    }
    for (Site site : getSiteList()) {
        if (site.getId().equals(id)) {
            return site;
        }
    }
    return new Site(id);
}

From source file:com.linkedin.pinot.controller.api.resources.PinotControllerHealthCheck.java

@GET
@Path("/")
@ApiOperation(value = "Check controller health")
@ApiResponses(value = { @ApiResponse(code = 200, message = "Good") })
@Produces(MediaType.TEXT_PLAIN)/* w w w .j  a v  a  2s . c o  m*/
public String checkHealth() {
    if (StringUtils.isNotBlank(controllerConf.generateVipUrl())) {
        return "GOOD";
    }
    return "";
}

From source file:cn.vlabs.umt.ui.servlet.PCookie.java

public String decrypt(String str) {
    if (StringUtils.isNotBlank(str)) {
        byte[] encrypted = HexUtil.toBytes(str);
        byte[] decrypted = keys.decrypt(encrypted);
        try {//ww w .  j a v a  2s  .c  o m
            if (decrypted != null) {
                return new String(decrypted, "UTF-8");
            }
        } catch (UnsupportedEncodingException e) {
        }
    }
    return null;
}

From source file:com.smartitengineering.jetty.session.replication.SessionReplicationAPI.java

private synchronized static void init() {
    if (api == null) {
        api = new SessionReplicationAPI();
        String val = System.getProperty(INITIALIZER_CLASS_SYS_PROP);
        if (LOGGER.isInfoEnabled()) {
            LOGGER.info("System parameter of the initializer " + val);
        }//from   ww w  .  j av a2 s.c  o m
        if (StringUtils.isNotBlank(val)) {
            try {
                Class.forName(val).newInstance();
            } catch (Exception ex) {
                LOGGER.error("Could not initialize initialzer class properly!", ex);
            }
        }
        BeanFactoryRegistrar.aggregate(api);
    }
}

From source file:com.ultrapower.eoms.common.plugin.ecside.view.html.TableActions.java

public String getOnInvokeAction() {
    String onInvokeAction = model.getTable().getOnInvokeAction();
    if (StringUtils.isNotBlank(onInvokeAction)) {
        return onInvokeAction;
    }//from w w  w .  j a  v a  2s. com
        
    return getSubmitAction();
}

From source file:de.hybris.platform.b2b.punchout.services.impl.DefaultCipherService.java

@Override
public String encrypt(final String userId, final PunchOutSession punchoutSession)
        throws PunchOutCipherException, IllegalArgumentException {
    if (StringUtils.isNotBlank(userId) && (punchoutSession != null) && (punchoutSession.getTime() != null)) {
        final String salt = AsymmetricManager.getSalt();
        final String key = SymmetricManager.getKey();
        punchoutSession.setSalt(salt);/*  w  w w  .  j ava  2  s .c o m*/
        punchoutSession.setKey(key);

        final String unsecureText = getUnsecureText(userId, punchoutSession);
        final String hash = AsymmetricManager.getHash(unsecureText, salt);
        final String encrypted = SymmetricManager.encrypt(userId + SEPARATOR + hash, key);

        return encode(encrypted);
    } else {
        final String msg = "Unable to encrypt user due empty or to missing arguments: userId=[" + userId
                + "] punchoutSession=[" + punchoutSession + "]";
        LOG.info(msg);
        throw new IllegalArgumentException(msg);
    }
}

From source file:edu.wfu.inotado.WakeServMockServer.java

public void handle(Request request, Response response) {
    try {/*w  w  w  .jav a 2s  .  co m*/
        String signature = request.getValue("Signature");
        if (StringUtils.isNotBlank(signature)) {
            log.info("Signature received on server: " + signature);
        }
        PrintStream body = response.getPrintStream();
        response.setValue("Content-Type", "application/xml");
        body.println(this.bodyText);
        body.close();
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:com.codestudio.dorm.web.util.PartyAuthUtil.java

/**
 * ???//from  w w  w  .  ja  v a2  s .co m
 * 
 * @param request
 * @param response
 * @return
 */
public static boolean isSignIn(HttpServletRequest request, HttpServletResponse response) {
    UserCookieManager userCookieManager = new UserCookieManager(request, response, null, "/");
    String partyId = userCookieManager.getTempCookie(UserCookieManager.PARTY_ID, null);
    return StringUtils.isNotBlank(partyId);
}

From source file:com.migo.utils.ScheduleRunnable.java

public ScheduleRunnable(String beanName, String methodName, String params)
        throws NoSuchMethodException, SecurityException {
    this.target = SpringContextUtils.getBean(beanName);
    this.params = params;

    if (StringUtils.isNotBlank(params)) {
        this.method = target.getClass().getDeclaredMethod(methodName, String.class);
    } else {//from w ww  .  j a  v  a2 s  .co  m
        this.method = target.getClass().getDeclaredMethod(methodName);
    }
}

From source file:com.hiperium.web.common.dto.PopupMessageDTO.java

/**
 * /*from  www .j av  a  2  s.  co  m*/
 * @param clientId
 * @param message
 * @param severity
 * @param label
 */
public PopupMessageDTO(String clientId, String message, Severity severity, String label) {
    this.clientId = clientId;
    this.message = message;
    this.severity = severity;
    if (StringUtils.contains(this.message, REPLACEMENT) && StringUtils.isNotBlank(label)) {
        this.message = this.message.replaceFirst(REPLACEMENT, label);
    }
}