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:cec.easyshop.storefront.controllers.cms.CartSuggestionComponentController.java

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

From source file:com.haulmont.cuba.gui.export.ExportFormat.java

public static ExportFormat getByExtension(String extension) {
    if (StringUtils.isEmpty(extension)) {
        return OCTET_STREAM;
    }/*w  w w.  ja  v  a  2 s  . c  o  m*/

    String extLowerCase = StringUtils.lowerCase(extension);

    List<ExportFormat> formats = DEFAULT_FORMATS;
    for (ExportFormat f : formats) {
        if (f.getFileExt().equals(extLowerCase))
            return f;
    }
    return OCTET_STREAM;
}

From source file:com.goosby.virgo.utils.PageRequest.java

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

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

    this.orderDir = lowcaseOrderDir;
}

From source file:com.daimler.spm.b2bacceleratoraddon.security.B2BAcceleratorAuthenticationProvider.java

/**
 * @see de.hybris.platform.acceleratorstorefrontcommons.security.AbstractAcceleratorAuthenticationProvider#additionalAuthenticationChecks(org.springframework.security.core.userdetails.UserDetails,
 *      org.springframework.security.authentication.AbstractAuthenticationToken)
 *//*from  w w w .  jav  a  2 s  . c  o  m*/
@Override
protected void additionalAuthenticationChecks(final UserDetails details,
        final AbstractAuthenticationToken authentication) throws AuthenticationException {
    super.additionalAuthenticationChecks(details, authentication);

    final UserModel userModel = getUserService().getUserForUID(StringUtils.lowerCase(details.getUsername()));
    final UserGroupModel b2bgroup = getUserService().getUserGroupForUID(B2BConstants.B2BGROUP);
    // Check if the customer is B2B type
    if (getUserService().isMemberOfGroup(userModel, b2bgroup)) {
        if (!getB2bUserGroupProvider().isUserAuthorized(details.getUsername())) {
            throw new InsufficientAuthenticationException(
                    messages.getMessage("checkout.error.invalid.accountType", "You are not allowed to login"));
        }

        // if its a b2b user, check if it is active
        if (!getB2bUserGroupProvider().isUserEnabled(details.getUsername())) {
            throw new DisabledException("User " + details.getUsername() + " is disabled... "
                    + messages.getMessage("text.company.manage.units.disabled"));
        }
    }
}

From source file:cec.easyshop.storefront.controllers.cms.PurchasedCategorySuggestionComponentController.java

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

From source file:mitm.common.extractor.impl.TextExtractorFactoryRegistryImpl.java

private String normalizeMimeType(String mimeType) {
    return StringUtils.trimToEmpty(StringUtils.lowerCase(mimeType));
}

From source file:mitm.common.dlp.impl.MatchFilterRegistryImpl.java

@Override
public synchronized void addMatchFilter(MatchFilter filter) {
    Check.notNull(filter, "filter");

    String name = StringUtils.lowerCase(filter.getName());

    if (StringUtils.isEmpty(name)) {
        throw new IllegalArgumentException("Filter name is empty.");
    }/*from   w w w  .  j  a va2  s  . co  m*/

    if (filters.containsKey(name)) {
        throw new IllegalArgumentException("Filter with name " + name + " is already registered.");
    }

    filters.put(name, filter);
}

From source file:com.enonic.vertical.userservices.PortalHandlerController.java

@Override
protected void handlerCustom(HttpServletRequest request, HttpServletResponse response, HttpSession session,
        ExtendedMap formItems, UserServicesService userServices, SiteKey siteKey, String operation)
        throws VerticalUserServicesException, VerticalEngineException, IOException, ClassNotFoundException,
        IllegalAccessException, InstantiationException, ParseException {

    PortalOperation portalOperation = null;
    try {/*w  w  w.  j ava 2s  .  c om*/
        portalOperation = PortalOperation.valueOf(StringUtils.lowerCase(operation));
    } catch (IllegalArgumentException e) {
        throw new VerticalUserServicesException(
                "Operation: " + operation + " not supported in service " + " portal");
    }

    ResolverContext resolverContext = new ResolverContext(request, getSite(siteKey));

    switch (portalOperation) {
    case forcedeviceclass:
        handleForceDeviceClass(resolverContext, response, formItems);
        break;
    case resetdeviceclass:
        handleResetDeviceClass(resolverContext, response);
        break;
    case forcelocale:
        handleForceLocale(resolverContext, response, formItems);
        break;
    case resetlocale:
        handleResetLocale(resolverContext, response);
        break;
    }

    redirectToPage(request, response, formItems);
}

From source file:com.proper.uip.common.utils.Page.java

/**
 * ???.//ww w.j  a va  2s. com
 * 
 * @param order ?descasc,?','.
 */
public void setOrder(final String order) {
    String lowcaseOrder = StringUtils.lowerCase(order);

    //order?
    String[] orders = StringUtils.split(lowcaseOrder, ',');
    for (String orderStr : orders) {
        if (!StringUtils.equals(PageConfig.DESC, orderStr) && !StringUtils.equals(PageConfig.ASC, orderStr)) {
            throw new IllegalArgumentException("??" + orderStr + "??");
        }
    }

    this.order = lowcaseOrder;
}

From source file:com.healthcit.analytics.dao.impl.JdbcReportTemplateDAO.java

@Override
public List<ReportTemplate> getReportTemplatesByTitle(String title) {
    String sql = messageSource.getMessage(Constants.GET_REPORT_BY_TITLE_SQL, null, Locale.getDefault());

    List<ReportTemplate> results = jdbcTemplate.query(sql, new Object[] { StringUtils.lowerCase(title) },
            new ReportTemplateRowMapper());

    return results;
}