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

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

Introduction

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

Prototype

public static String lowerCase(String str) 

Source Link

Document

Converts a String to lower case as per String#toLowerCase() .

Usage

From source file:de.hybris.platform.ycommercewebservices.security.AuthenticationFailureListener.java

/**
 * Disable user account//from   w w w .  ja  v a  2  s .co m
 * 
 * @param user
 *           user identifier
 */
protected void disableUser(final String user) {
    try {
        final UserModel userModel = getUserService().getUserForUID(StringUtils.lowerCase(user));
        if (!userModel.isLoginDisabled()) {
            userModel.setLoginDisabled(true);
            getModelService().save(userModel);
            LOG.warn(
                    "Account for user '" + user + "' was disabled because of too many authentication failures");
        }
        bruteForceAttackCounter.resetUserCounter(user);
    } catch (final UnknownIdentifierException e) {
        LOG.debug("Brute force attack attempt for non existing user name " + user);
    }
}

From source file:com.enonic.cms.core.search.query.QueryValue.java

String getWildcardValue() {
    final String replacedWildcardsString = StringUtils.replace(this.stringValue, "%", "*");
    return StringUtils.lowerCase(replacedWildcardsString);
}

From source file:de.forsthaus.webui.logging.loginlog.model.SecLoginlogStatisticTotalListModelItemRenderer.java

@Override
public void render(Listitem item, Object data) throws Exception {

    final DummyBean dummyBean = (DummyBean) data;

    Listcell lc;/*from   w  w w .j  av a2 s  . c om*/

    lc = new Listcell();
    final Hbox hbox = new Hbox();
    hbox.setParent(lc);

    /* Flag-image */
    final Image img = new Image();
    final String path = "/images/countrycode_flags/";
    final String flag = StringUtils.lowerCase(dummyBean.getCountry()) + ".gif";
    img.setSrc(path + flag);
    hbox.appendChild(img);

    final Separator sep = new Separator();
    hbox.appendChild(sep);

    /* Country */
    final Label label = new Label();
    label.setValue(dummyBean.getCountry());
    hbox.appendChild(label);
    lc.setParent(item);

    lc = new Listcell(dummyBean.getCountryName());
    lc.setParent(item);

    lc = new Listcell(dummyBean.getTotalCount().toString());
    lc.setStyle("text-align: right");
    lc.setParent(item);

    item.setAttribute("data", data);
    // ComponentsCtrl.applyForward(img, "onClick=onImageClicked");
    // ComponentsCtrl.applyForward(item, "onClick=onClicked");
    // ComponentsCtrl.applyForward(item, "onDoubleClick=onDoubleClicked");

}

From source file:com.evolveum.midpoint.prism.match.UuidMatchingRule.java

@Override
public String normalize(String original) {
    if (original == null) {
        return null;
    }/*ww w  .  java  2 s. c o  m*/
    return StringUtils.lowerCase(original).trim();
}

From source file:com.nagarro.core.security.AuthenticationFailureListener.java

/**
 * Disable user account/*from  w w  w.j av  a  2  s  .  co m*/
 * 
 * @param user
 *           user identifier
 */
protected void disableUser(final String user) {
    try {
        final UserModel userModel = getUserService().getUserForUID(StringUtils.lowerCase(user));
        if (!userModel.isLoginDisabled()) {
            userModel.setLoginDisabled(true);
            getModelService().save(userModel);
            LOG.warn(
                    "Account for user '" + user + "' was disabled because of too many authentication failures");
        }
        bruteForceAttackCounter.resetUserCounter(user);
    } catch (final UnknownIdentifierException e) {
        LOG.debug("Brute force attack attempt for non existing user name " + YSanitizer.sanitize(user));
    }
}

From source file:com.dattack.dbtools.drules.beans.Identifier.java

private static String normalize(final String text) {
    return StringUtils.trim(StringUtils.lowerCase(text));
}

From source file:com.enonic.cms.core.search.query.QueryValue.java

private String doNormalizeString(final String stringValue) {
    return StringUtils.lowerCase(stringValue);
}

From source file:hydrograph.ui.dataviewer.find.StyledTextEventListener.java

/**
 *  The function will move cursor in reverse direction.
 * @param styledText//from w w w . ja v a  2s . c  o  m
 * @param text
 * @param prevLineIndex
 * @param nextLineIndex
 * @return int[]
 */
public int[] prevButtonListener(StyledText styledText, String text, int prevLineIndex, int nextLineIndex) {
    logger.debug("StyledText prev button selected");
    if (prevLineIndex == 0) {
        prevLineIndex = styledText.getText().length() - 1;
    }
    int lastIndex = StringUtils.lastIndexOf(StringUtils.lowerCase(styledText.getText()),
            StringUtils.lowerCase(text), prevLineIndex - 1);

    if (lastIndex < 0) {
        prevLineIndex = styledText.getText().length() - 1;
        prevLineIndex = StringUtils.lastIndexOf(StringUtils.lowerCase(styledText.getText()),
                StringUtils.lowerCase(text), prevLineIndex - 1);
        styledText.setSelection(prevLineIndex);
        setStyledRange(styledText, prevLineIndex, text.length(), null,
                Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY));
        nextLineIndex = prevLineIndex + 1;
        return new int[] { prevLineIndex, nextLineIndex };
    } else {
        setStyledRange(styledText, lastIndex, text.length(), null,
                Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY));
        styledText.setSelection(lastIndex);
        prevLineIndex = lastIndex;
        nextLineIndex = lastIndex + 1;
        styledText.redraw();
    }
    return new int[] { prevLineIndex, nextLineIndex };
}

From source file:com.pedra.storefront.controllers.cms.PurchasedProductReferenceComponentController.java

@Override
protected String getView(final PurchasedProductReferencesComponentModel component) {
    return ControllerConstants.Views.Cms.ComponentPrefix
            + StringUtils.lowerCase(PurchasedProductReferencesComponentModel._TYPECODE);
}

From source file:cn.hxh.springside.orm.PageRequest.java

/**
 * ???./* w  ww  . j a v a2s. co m*/
 * 
 * @param orderDir ?descasc,?','.
 */
public void setOrderDir(final String orderDir) {
    String lowcaseOrderDir = StringUtils.lowerCase(orderDir);

    //order?
    String[] orderDirs = StringUtils.split(lowcaseOrderDir, ',');
    for (String orderDirStr : orderDirs) {
        if (!StringUtils.equals(Sort.DESC, orderDirStr) && !StringUtils.equals(Sort.ASC, orderDirStr)) {
            throw new IllegalArgumentException("??" + orderDirStr + "??");
        }
    }

    this.orderDir = lowcaseOrderDir;
}