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

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

Introduction

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

Prototype

public static boolean isNotEmpty(String str) 

Source Link

Document

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

Usage

From source file:com.enonic.cms.core.localization.LocalizationServiceImpl.java

@Override
public String getLocalizedPhrase(final SiteEntity site, final String phrase, final Object[] arguments,
        final Locale locale) {
    if (noLocalizationResourceDefinedForSite(site)) {
        return createNotTranslated(phrase);
    }/*from   www .  j  a  va 2 s  . co m*/

    if (locale == null) {
        return createNotTranslated(phrase);
    }

    final LocalizationResourceBundle localizationResourceBundle = getResourceBundleForLocale(site, locale);
    if (localizationResourceBundle == null) {
        return createNotTranslated(phrase);
    }

    final String localizedPhrase = getLocalizedPhrase(phrase, arguments, localizationResourceBundle);
    return StringUtils.isNotEmpty(localizedPhrase) ? localizedPhrase : createNotTranslated(phrase);
}

From source file:ch.cyberduck.ui.cocoa.UserDefaultsPortablePreferences.java

@Override
public void setProperty(String property, String value) {
    log.info("setProperty:" + property + "," + value);
    if (StringUtils.isNotEmpty(value)) {
        this.dict.setObjectForKey(value, property);
    } else {/*from   ww  w. jav a 2 s.  com*/
        this.deleteProperty(property);
    }
}

From source file:iddb.web.viewbean.NoticeViewBean.java

@Override
public String toString() {
    StringBuilder s = new StringBuilder();
    DateFormat format = new SimpleDateFormat("dd/MM/yyyy");
    format.setTimeZone(TimeZone.getTimeZone("GMT-3"));

    s.append(getReason()).append(". ");
    s.append("Agregado el ").append(format.format(this.getCreated()));
    if (StringUtils.isNotEmpty(this.getAdmin())) {
        s.append(" por ").append(getAdmin());
    }// w w  w .j a v  a2s  .  co  m
    return s.toString();
}

From source file:com.enonic.cms.core.localization.LocalizationResourceBundle.java

public String getLocalizedPhrase(String s, Object[] arguments) {
    String message = (String) handleGetObject(s);

    return StringUtils.isNotEmpty(message) ? MessageFormat.format(message, arguments) : null;
}

From source file:net.kamhon.ieagle.vo.Time.java

public int getHour() {
    if (StringUtils.isNotEmpty(time)) {
        String[] splittedTime = time.split(":");
        if (splittedTime.length > 0)
            return Integer.parseInt(splittedTime[0].trim());
    }//from  w w w . j a  va  2s .  c  o m
    return 0;
}

From source file:io.sidecar.security.signature.SignatureVersionOne.java

@Override
public String getStringToSign() {
    // order matters! method + uri + date + md5(opt) + version
    StringBuilder s = new StringBuilder();
    s.append(method).append(DELIMITER);/*from   w w  w . java2  s . co  m*/
    s.append(uri).append(DELIMITER);
    s.append(dateString).append(DELIMITER);

    // only applies to PUT or POST
    if (StringUtils.isNotEmpty(contentMd5)) {
        s.append(contentMd5).append(DELIMITER);
    }
    return s.append(getVersion().digit).toString();
}

From source file:com.haulmont.cuba.security.sys.TrustedLoginHandler.java

protected String convertToRegex(String ipList) {
    String regex = null;/*from w w w  . java 2 s.  c om*/
    if (StringUtils.isNotEmpty(ipList)) {
        regex = ipList;
        regex = regex.replace(" ", "").replace(",", "|").replace("*", "([01]?\\d\\d?|2[0-4]\\d|25[0-5])")
                .replace(".", "\\.");
    }
    return regex;
}

From source file:com.haulmont.cuba.gui.app.core.appproperties.AppPropertiesDatasource.java

@Override
protected Collection<AppPropertyEntity> getEntities(Map<String, Object> params) {
    List<AppPropertyEntity> entities = loadAppPropertyEntities();

    String name = (String) params.get("name");
    if (StringUtils.isNotEmpty(name)) {
        entities = entities.stream().filter(it -> it.getName().toLowerCase().contains(name.toLowerCase()))
                .collect(Collectors.toList());
    }/*from  ww  w .  ja v a2s  . co m*/

    return createEntitiesTree(entities);
}

From source file:de.hybris.platform.acceleratorstorefrontcommons.strategy.impl.MergingCartRestorationStrategy.java

@Override
public void restoreCart(final HttpServletRequest request) {
    // no need to merge if current cart has no entry
    if (!getCartFacade().hasEntries()) {
        super.restoreCart(request);
    } else {/*from w  ww  . ja  va 2 s  . c  o m*/
        final String sessionCartGuid = getCartFacade().getSessionCartGuid();
        final String mostRecentSavedCartGuid = getMostRecentSavedCartGuid(sessionCartGuid);
        if (StringUtils.isNotEmpty(mostRecentSavedCartGuid)) {
            getSessionService().setAttribute(WebConstants.CART_RESTORATION_SHOW_MESSAGE, Boolean.TRUE);
            try {
                getSessionService().setAttribute(WebConstants.CART_RESTORATION,
                        getCartFacade().restoreCartAndMerge(mostRecentSavedCartGuid, sessionCartGuid));
                request.setAttribute(WebConstants.CART_MERGED, Boolean.TRUE);
            } catch (final CommerceCartRestorationException e) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug(e);
                }
                getSessionService().setAttribute(WebConstants.CART_RESTORATION_ERROR_STATUS,
                        WebConstants.CART_RESTORATION_ERROR_STATUS);
            } catch (final CommerceCartMergingException e) {
                LOG.error("User saved cart could not be merged", e);
            }
        }
    }
}

From source file:de.u808.simpleinquest.web.search.SearchController.java

protected boolean isFormSubmission(HttpServletRequest request) {
    if (StringUtils.isNotEmpty(request.getParameter(SEARCH_STRING))
            || StringUtils.isNotEmpty(request.getParameter(PAGE_INDEX))) {
        return true;
    }/*from w w  w. j av a  2s. com*/
    return false;
}