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:com.zb.app.web.controller.BaseController.java

protected JsonResult doLonginWithCheck(String account, String password, CompanyTypeEnum type) {
    account = StringUtils.trim(account);
    password = StringUtils.trim(password);
    password = EncryptBuilder.getInstance().encrypt(password);
    if (StringUtils.isEmpty(account) || StringUtils.isEmpty(password)) {
        return JsonResultUtils.error("!???!");
    }/*from  w  w  w  .  ja  va  2s.c  om*/
    // Query the database, check the user authentication information
    TravelMemberDO tm = memberService
            .getByName(new TravelMemberQuery(StringUtils.lowerCase(account), type.getValue()));
    if (tm == null) {
        return JsonResultUtils.error("!?!");
    }
    if (!StringUtils.equals(password, tm.getmPassword())) {
        return JsonResultUtils.error("!???!");
    }
    if (tm.getmState() == MemberStateEnum.STOP.getValue()) {
        return JsonResultUtils.error("!?!");
    }
    // ??
    TravelCompanyDO tc = companyService.getById(tm.getcId());
    if (tc == null) {
        return JsonResultUtils.error("!?!");
    }
    if (tc.getcType() != type.getValue()) {
        return JsonResultUtils.error("!?" + type.getDesc() + "!");
    }
    if (tc.getcState() != CompanyStateEnum.NORMAL.getValue()) {
        return JsonResultUtils.error("!??!");
    }
    // Verified, writing cookie
    tm.setmType(tc.getcType());
    String url = CompanyTypeEnum.getEnum(tc.getcType()).getIndexUrl();
    doLoginSuccess(tm);
    return JsonResultUtils.success(url, "?!");
}

From source file:cec.easyshop.storefront.interceptors.beforeview.CmsPageBeforeViewHandler.java

@Override
public void beforeView(final HttpServletRequest request, final HttpServletResponse response,
        final ModelAndView modelAndView) {
    modelAndView.addObject("cmsSite", cmsSiteService.getCurrentSite());

    // Look for the page in the model
    final AbstractPageModel page = updateCmsPageInModelAndView(request, modelAndView);

    modelAndView.addObject("pageBodyCssClasses", buildCssClasses(page));
    if (page != null) {
        final Set<String> actonJsFiles = new HashSet();

        final Collection<ContentSlotData> contentSlotsForPage = cmsPageService.getContentSlotsForPage(page);
        for (final ContentSlotData contentSlotData : contentSlotsForPage) {
            final ContentSlotModel contentSlot = contentSlotData.getContentSlot();
            final List<AbstractCMSComponentModel> cmsComponents = contentSlot.getCmsComponents();
            for (final AbstractCMSComponentModel cmsComponent : cmsComponents) {
                final List<AbstractCMSActionModel> actions = cmsComponent.getActions();
                for (final AbstractCMSActionModel action : actions) {
                    actonJsFiles.add(StringUtils.lowerCase(action.getItemtype()) + ".js");
                }/*from  w ww  .  j a  va  2s .  c  om*/
            }
        }
        modelAndView.addObject("cmsActionsJsFiles", actonJsFiles);
    }

    // Create the restriction data
    final RequestContextData requestContextData = SpringHelper.getSpringBean(request, "requestContextData",
            RequestContextData.class, true);
    final RestrictionData restrictionData = requestContextRestrictionConverter.convert(requestContextData);

    // Initialise CMS support
    final CmsPageRequestContextData cmsPageRequestContextData = cmsPageContextService
            .updateCmsPageContextForPage(request, page, restrictionData);
    modelAndView.addObject("cmsPageRequestContextData", cmsPageRequestContextData);

    sessionService.setAttribute(LocalizableItem.LANGUAGE_FALLBACK_ENABLED, Boolean.TRUE);
    sessionService.setAttribute(AbstractItemModel.LANGUAGE_FALLBACK_ENABLED_SERVICE_LAYER, Boolean.TRUE);
}

From source file:de.hybris.alantrails.storefront.interceptors.beforeview.CmsPageBeforeViewHandler.java

@Override
public void beforeView(final HttpServletRequest request, final HttpServletResponse response,
        final ModelAndView modelAndView) {
    modelAndView.addObject("cmsSite", cmsSiteService.getCurrentSite());

    // Look for the page in the model
    final AbstractPageModel page = updateCmsPageInModelAndView(request, modelAndView);

    modelAndView.addObject("pageBodyCssClasses", buildCssClasses(page));
    if (page != null) {
        final Set<String> actonJsFiles = new HashSet();

        final Collection<ContentSlotData> contentSlotsForPage = cmsPageService.getContentSlotsForPage(page);
        for (ContentSlotData contentSlotData : contentSlotsForPage) {
            final ContentSlotModel contentSlot = contentSlotData.getContentSlot();
            final List<AbstractCMSComponentModel> cmsComponents = contentSlot.getCmsComponents();
            for (AbstractCMSComponentModel cmsComponent : cmsComponents) {
                final List<AbstractCMSActionModel> actions = cmsComponent.getActions();
                for (AbstractCMSActionModel action : actions) {
                    actonJsFiles.add(StringUtils.lowerCase(action.getItemtype()) + ".js");
                }//from  w  ww  .  j a  va 2s .  c om
            }
        }
        modelAndView.addObject("cmsActionsJsFiles", actonJsFiles);
    }

    // Create the restriction data
    final RequestContextData requestContextData = SpringHelper.getSpringBean(request, "requestContextData",
            RequestContextData.class, true);
    final RestrictionData restrictionData = requestContextRestrictionConverter.convert(requestContextData);

    // Initialise CMS support
    final CmsPageRequestContextData cmsPageRequestContextData = cmsPageContextService
            .updateCmsPageContextForPage(request, page, restrictionData);
    modelAndView.addObject("cmsPageRequestContextData", cmsPageRequestContextData);

    sessionService.setAttribute(LocalizableItem.LANGUAGE_FALLBACK_ENABLED, Boolean.TRUE);
    sessionService.setAttribute(AbstractItemModel.LANGUAGE_FALLBACK_ENABLED_SERVICE_LAYER, Boolean.TRUE);
}

From source file:hydrograph.ui.engine.converter.OutputConverter.java

/**
 * Caches the parameter value for later substitution in engine xml.
 * @param propertyName//  w ww  .  j av  a2 s . c o m
 * @return
 */
protected TypeTrueFalse getTrueFalse(String propertyName) {
    logger.debug("Getting TrueFalse Value for {}={}",
            new Object[] { propertyName, properties.get(propertyName) });
    TypeTrueFalse typeTrueFalse = new TypeTrueFalse();
    if (StringUtils.isNotBlank((String) properties.get(propertyName))) {
        try {
            Object object = properties.get(propertyName);
            typeTrueFalse.setValue(TrueFalse.fromValue(StringUtils.lowerCase((String) object)));
        } catch (IllegalArgumentException exception) {
            ComponentXpath.INSTANCE.getXpathMap()
                    .put((ComponentXpathConstants.COMPONENT_XPATH_BOOLEAN.value().replace(ID, componentName))
                            .replace(Constants.PARAM_PROPERTY_NAME, propertyName),
                            new ComponentsAttributeAndValue(null, properties.get(propertyName).toString()));
            typeTrueFalse.setValue(TrueFalse.TRUE);
        }
    }
    return typeTrueFalse;
}

From source file:de.hybris.platform.addonsupport.controllers.cms.AbstractCMSAddOnComponentController.java

protected String getViewResourceName(final T component) {
    return StringUtils.lowerCase(getTypeCode(component));
}

From source file:com.streamreduce.core.model.ConnectionCredentials.java

@Override
public int hashCode() {
    return new HashCodeBuilder().append(StringUtils.lowerCase(identity)).append(credential).append(apiKey)
            .append(oauthToken).append(oauthTokenSecret).append(oauthVerifier).append(oauthRefreshToken)
            .toHashCode();/*from   w  ww  . j  a v a2 s .c  o  m*/
}

From source file:chiliad.parser.pdf.cli.ParserCli.java

public ParserOutputWriter getOutputFormat() {
    try {//  w  w  w .j av a  2s  .co  m
        String format = StringUtils.lowerCase(commandLine.getOptionValue(outputFormat.getOpt(), JSON_OUTPUT));
        switch (format) {
        case JSON_OUTPUT:
            return new JSONOutput(new FileWriter(outputFile(format)));
        case HTML_OUTPUT:
            return new HTMLOutput(new FileWriter(outputFile(format)));
        default:
            return new PlainStringOutput(new FileWriter(outputFile(format)));
        }
    } catch (IOException ex) {
        throw new ParserOutputException("Failed to create parser output.", ex);
    }
}

From source file:com.enonic.cms.web.portal.services.PortalServicesProcessor.java

private ForcedResolverValueLifetimeSettings getForcedDeviceClassSetting(ExtendedMap formItems) {

    ForcedResolverValueLifetimeSettings defaultSetting = ForcedResolverValueLifetimeSettings.permanent;
    String forcedDeviceClassParameter = formItems.getString(FORCE_VALUE_SETTING_KEY, defaultSetting.name());

    ForcedResolverValueLifetimeSettings forcedDeviceClassSetting;
    try {//from  ww  w. j  a va  2  s  . co m
        forcedDeviceClassSetting = ForcedResolverValueLifetimeSettings
                .valueOf(StringUtils.lowerCase(forcedDeviceClassParameter));
    } catch (IllegalArgumentException e) {
        throw new VerticalUserServicesException(
                "Force deviceclass setting is invalid: " + forcedDeviceClassParameter);
    }
    return forcedDeviceClassSetting;
}

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

private ForcedResolverValueLifetimeSettings getForcedDeviceClassSetting(ExtendedMap formItems,
        ForcedResolverValueLifetimeSettings defaultSetting) {

    String forcedDeviceClassParameter = formItems.getString(FORCE_VALUE_SETTING_KEY, defaultSetting.name());

    ForcedResolverValueLifetimeSettings forcedDeviceClassSetting;
    try {/*www .java2  s . co m*/
        forcedDeviceClassSetting = ForcedResolverValueLifetimeSettings
                .valueOf(StringUtils.lowerCase(forcedDeviceClassParameter));
    } catch (IllegalArgumentException e) {
        throw new VerticalUserServicesException(
                "Force deviceclass setting is invalid: " + forcedDeviceClassParameter);
    }
    return forcedDeviceClassSetting;
}

From source file:mitm.common.fetchmail.Poll.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }// w  w w. j  a v  a2  s.  com
    if (obj == this) {
        return true;
    }

    if (obj.getClass() != getClass()) {
        return false;
    }

    Poll rhs = (Poll) obj;

    return new EqualsBuilder().append(StringUtils.lowerCase(server), StringUtils.lowerCase(rhs.server))
            .append(port, rhs.port).append(protocol, rhs.protocol).append(username, rhs.username).isEquals();
}