org.clazzes.util.http
Class LocaleHelper
java.lang.Object
org.clazzes.util.http.LocaleHelper
public abstract class LocaleHelper
- extends Object
This class provides static functionality for handling locales.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LocaleHelper
public LocaleHelper()
getLocaleMatcher
public static final AcceptMatcher getLocaleMatcher()
- Returns:
- A matcher for locales in an
Accept-Language
header.
selectLocale
public static String selectLocale(String acceptLanguage,
String[] supportedLocales)
- Parameters:
acceptLanguage
- The content of an Accept-Language header (see section 14.3 of RFC2616).supportedLocales
- A list of supported encodings to choose from.
- Returns:
- The encoding selected to use for the given browser of
null
, if no
matching encoding could be found.
Copyright © 2012. All Rights Reserved.