Returns a Vector of locales from the passed in request object.

@param req The request object to extract the locales from.

@return The extracted locales.
967431
public static Vector getLocales(HttpServletRequest req) {
    	init();
        String acceptLanguage = req.getHeader("Accept-Language");
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
            logger.logp(Level.FINE, CLASS_NAME,"getLocales", "Accept-Language --> " + acceptLanguage);
        }

        // Short circuit with an empty enumeration if null header
        if ((acceptLanguage == null)|| (acceptLanguage.trim().length() ==0)) { 
            Vector def = new Vector();
            def.addElement(Locale.getDefault());
            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
                logger.logp(Level.FINE, CLASS_NAME,"getLocales", "processed Locales --> ", def);
            }
            return def;
        }

        // Check cache
        Vector langList = null;
        langList = (Vector) localesCache.get(acceptLanguage);

        if (langList == null) {
            // Create and add to cache
            langList = processAcceptLanguage(acceptLanguage);
          
            if(WCCustomProperties.VALIDATE_LOCALE_VALUES){
                langList = extractLocales(langList , true);
            }
            else
                langList = extractLocales(langList , false);
            
            localesCache.put(acceptLanguage, langList);
        }

        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
            logger.logp(Level.FINE, CLASS_NAME,"getLocales", "processed Locales --> " + langList);
        }

        return langList;
    }
1210425
function parseListRequest(req){
  var reqObj = {};
  reqObj.originalUrl = req.originalUrl;
  reqObj.uid = req.params.guid;
  reqObj.env = req.params.environment;
  reqObj.domain = req.params.domain;
  return reqObj;
}
44530
public Locale getCurrentUserLocale(PortletRequest request) {
        final HttpServletRequest originalPortalRequest =
                this.portalRequestUtils.getPortletHttpRequest(request);
        IUserInstance ui = userInstanceManager.getUserInstance(originalPortalRequest);
        IUserPreferencesManager upm = ui.getPreferencesManager();
        final IUserProfile userProfile = upm.getUserProfile();
        LocaleManager localeManager = userProfile.getLocaleManager();

        // first check the session locales
        List<Locale> sessionLocales = localeManager.getSessionLocales();
        if (sessionLocales != null && sessionLocales.size() > 0) {
            return sessionLocales.get(0);
        }

        // if no session locales were found, check the user locales
        List<Locale> userLocales = localeManager.getUserLocales();
        if (userLocales != null && userLocales.size() > 0) {
            return userLocales.get(0);
        }

        // if no selected locale was found either in the session or user layout,
        // just return null
        return null;
    }
450709
Locale getLocale(HandshakeRequest request) {
		if(null != request) {
			Map<String, List<String>> headers = request.getHeaders();
			if(null != headers) {
				List<String> accepts = headers.get(HttpHeaders.ACCEPT_LANGUAGE);
				logger.debug("Get accept-language from client headers : {}", accepts);
				if (null != accepts) {
					for (String accept : accepts) {
						try {
							return localeExtractor.extractFromAccept(accept);
						} catch (LocaleNotFoundException ex) {
						}
					}
				}
			}
		}
		return Locale.US;
	}
392554
private static Map<String, String> __getRequestHeaderMap(HttpServletRequest req) {
        Map<String, String> reqHeaders = new LinkedHashMap<>();
        Enumeration<String> headerNames = req.getHeaderNames();
        if (headerNames != null) {
            while (headerNames.hasMoreElements()) {
                String headerName = headerNames.nextElement();
                Enumeration<String> headerValues = req.getHeaders(headerName);

                if (headerValues != null) {
                    StringBuilder headerValueBuilder = new StringBuilder();
                    int i = 0;
                    while (headerValues.hasMoreElements()) {
                        if (i > 0) {
                            headerValueBuilder.append(", ");
                        }

                        headerValueBuilder.append(headerValues.nextElement());
                        i++;
                    }

                    reqHeaders.put(headerName, headerValueBuilder.toString());
                } else {
                    reqHeaders.put(headerName, "");
                }
            }
        }
        return reqHeaders;
    }
1109687
public List<LocaleEncodingMappingListType<WebFragmentType<T>>> getAllLocaleEncodingMappingList()
   {
      List<LocaleEncodingMappingListType<WebFragmentType<T>>> list = new ArrayList<LocaleEncodingMappingListType<WebFragmentType<T>>>();
      List<Node> nodeList = childNode.get("locale-encoding-mapping-list");
      for(Node node: nodeList)
      {
         LocaleEncodingMappingListType<WebFragmentType<T>>  type = new LocaleEncodingMappingListTypeImpl<WebFragmentType<T>>(this, "locale-encoding-mapping-list", childNode, node);
         list.add(type);
      }
      return list;
   }
529410
function(req) {
	return ((req.headers.origin && req.headers.origin !== "null") ? req.headers.origin : "*");
}
223407
public Locale getLocale()
    {
        Enumeration enm = _httpRequest.getFieldValues(HttpFields.__AcceptLanguage,
                                                       HttpFields.__separators);

        // handle no locale
        if (enm == null || !enm.hasMoreElements())
            return Locale.getDefault();
        
        // sort the list in quality order
        List acceptLanguage = HttpFields.qualityList(enm);
        if (acceptLanguage.size()==0)
            return  Locale.getDefault();

        int size=acceptLanguage.size();
        
        // convert to locals
        for (int i=0; i<size; i++)
        {
            String language = (String)acceptLanguage.get(i);
            language=HttpFields.valueParameters(language,null);
            String country = "";
            int dash = language.indexOf('-');
            if (dash > -1)
            {
                country = language.substring(dash + 1).trim();
                language = language.substring(0,dash).trim();
            }
            return new Locale(language,country);
        }

        return  Locale.getDefault();
    }
1106017
@Route(method = HttpMethod.GET, uri = "i18n/bundles/{file<.+>}.json")
    public Result getBundleResourceForI18Next(@QueryParameter("locales") String listOfLocales,
                                              @HttpParameter(HeaderNames.IF_NONE_MATCH) String ifNoneMatch) {
        // Parse the list of locale
        List<Locale> locales = new ArrayList<>();
        if (!Strings.isNullOrEmpty(listOfLocales)) {
            String[] items = listOfLocales.split(" ");
            for (String item : items) {
                // Manage the 'dev' value (it's the default locale used by i18next
                if ("dev".equalsIgnoreCase(item)) {
                    locales.add(InternationalizationService.DEFAULT_LOCALE);
                } else {
                    locales.add(Locale.forLanguageTag(item));
                }
            }
        }

        String etag;
        StringBuilder builder = new StringBuilder();
        for (Locale locale : locales) {
            builder.append(service.etag(locale));
        }
        etag = builder.toString();

        if (ifNoneMatch != null && ifNoneMatch.equals(etag)) {
            return new Result(Status.NOT_MODIFIED);
        }

        // i18next use a specific Json Format
        ObjectNode result = json.newObject();
        for (Locale locale : locales) {
            ObjectNode lang = json.newObject();
            ObjectNode translation = json.newObject();
            lang.set("translation", translation);
            Collection<ResourceBundle> bundles = service.bundles(locale);
            for (ResourceBundle bundle : bundles) {
                for (String key : bundle.keySet()) {
                    populateJsonResourceBundle(translation, key, bundle.getString(key));
                }
            }
            String langName = locale.toLanguageTag();
            if (locale.equals(InternationalizationService.DEFAULT_LOCALE)) {
                langName = "dev";
            }
            result.set(langName, lang);
        }
        return ok(result).with(HeaderNames.ETAG, etag);
    }
735858
public Locale getWorkplaceLocale(CmsRequestContext requestContext) {

        Locale wpLocale = new CmsUserSettings(requestContext.getCurrentUser()).getLocale();
        if (wpLocale == null) {
            // fall back
            wpLocale = getDefaultLocale();
            if (wpLocale == null) {
                // fall back
                wpLocale = requestContext.getLocale();
            }
        }
        return wpLocale;

    }
787742
private static Locale getLocaleForRequest(HttpServletRequest req) {

        CmsAcceptLanguageHeaderParser parser = new CmsAcceptLanguageHeaderParser(
            req,
            OpenCms.getWorkplaceManager().getDefaultLocale());
        List<Locale> acceptedLocales = parser.getAcceptedLocales();
        List<Locale> workplaceLocales = OpenCms.getWorkplaceManager().getLocales();
        Locale locale = OpenCms.getLocaleManager().getFirstMatchingLocale(acceptedLocales, workplaceLocales);
        if (locale == null) {
            // no match found - use OpenCms default locale
            locale = OpenCms.getWorkplaceManager().getDefaultLocale();
        }
        return locale;
    }
530988
String getRemarks() {

        if (!locale_set) {
            setLocale(Locale.getDefault());
        }

        String key = this.getTypeName();

        return BundleHandler.getString(hnd_remarks, key);
    }
831492
public static List<Locale> getLocales(String localeNames) {

        if (localeNames == null) {
            return null;
        }
        return getLocales(CmsStringUtil.splitAsList(localeNames, ','));
    }
224387
public List<ULocale> getLocales() {
        List<ULocale> result;
        if (locales == null) {
            result = guessLocales();
        } else {
            result = new ArrayList<ULocale>();
            result.addAll(locales);
        }
        return result;
    }
742036
public static List<String> getAvailableLocaleSuffixesForBundle(String messageBundlePath,
			ServletContext servletContext) {

		return getAvailableLocaleSuffixesForBundle(messageBundlePath, MSG_RESOURCE_BUNDLE_SUFFIX, servletContext);
	}
1063779
public static String getLocation (HttpServletRequest req)
    {
        StringBuffer rurl = req.getRequestURL();
        String qs = req.getQueryString();
        if (qs != null) {
            rurl.append("?").append(qs);
        }
        return rurl.toString();
    }
196706
private static List<String> tokens(final Request req) throws IOException {
        final List<String> tokens = new LinkedList<>();
        final Iterable<String> headers =
            new RqHeaders.Base(req).header("User-Agent");
        for (final String header : headers) {
            final Matcher matcher = PATTERN.matcher(header);
            if (matcher.matches()) {
                tokens.add(matcher.group());
            }
        }
        return tokens;
    }