use of org.apache.commons.lang3.LocaleUtils in project fess by codelibs.
the class FessUserLocaleProcessProvider method findBusinessLocale.
@Override
public OptionalThing<Locale> findBusinessLocale(final ActionRuntime runtimeMeta, final RequestManager requestManager) {
final FessConfig fessConfig = ComponentUtil.getFessConfig();
final String name = fessConfig.getQueryBrowserLangParameterName();
if (StringUtil.isNotBlank(name)) {
try {
return requestManager.getParameter(name).filter(StringUtil::isNotBlank).map(LocaleUtils::toLocale);
} catch (final Exception e) {
logger.debug("Failed to parse a value of " + name + ".", e);
}
}
return OptionalObject.empty();
}
Aggregations