Package org.wymiwyg.wrhapi.util

Examples of org.wymiwyg.wrhapi.util.AcceptLanguagesIterator


    Resource item = model.createResource(itemURIString);
    String recipientURIStrings[] = body.getParameterValues("recipient");
    if (recipientURIStrings == null) {
      throw new HandlerException("A recipient must be specified");
    }
    AcceptLanguagesIterator acceptedLanguages = ehRequest.getAcceptLanguages();
    InternetAddress fromAddress;
    String fromString = body.getParameter("from");
    if ((fromString != null) && (!fromString.equals(""))) {
      try {
        fromAddress = getIntenetAddress(model.createResource(fromString));
View Full Code Here


      throw new HandlerException(e);
    }
    Locale locale = resources[0].getLocale();
    if (locale != null) {
      // check if locale in accept-language
      AcceptLanguagesIterator acceptedLangIter = ehRequest
          .getAcceptLanguages();
      boolean acceptable = false;
      while (acceptedLangIter.hasNext()) {
        if (acceptedLangIter.nextAcceptLanguageHeader()
            .getLocaleRange().match(locale)) {
          acceptable = true;
          break;
        }
      }
View Full Code Here

    }
    return 0;
  }

  private float getLangQ(Locale locale) {
    AcceptLanguagesIterator langIter;
    try {
      langIter = request.getAcceptLanguages();
    } catch (HandlerException e) {
      throw new RuntimeException(e);
    }
    while (langIter.hasNext()) {
      AcceptLanguageHeaderEntry current = langIter
          .nextAcceptLanguageHeader();
      if (current.getLocaleRange().match(locale)) {
        return current.getQ();
      }
    }
View Full Code Here

TOP

Related Classes of org.wymiwyg.wrhapi.util.AcceptLanguagesIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.