Class RewriteLanguageRule

java.lang.Object
org.eclipse.jetty.rewrite.handler.Rule
org.eclipse.jetty.rewrite.handler.RewriteLanguageRule

public class RewriteLanguageRule extends Rule
Rule that can rewrite a request based on the Accept-Language header.
  • Constructor Details

  • Method Details

    • localizeWithSuffix

      public static String localizeWithSuffix(String pathInContext, String language)
    • localizeWithPrefix

      public static String localizeWithPrefix(String pathInContext, String language)
    • getResource

      public static Resource getResource(Context context, String pathInContext)
    • matchAndApply

      public Rule.Handler matchAndApply(Rule.Handler input) throws IOException
      Description copied from class: Rule

      Tests whether the given input Handler (which wraps a Request) matches the rule, and if so returns an output Handler that applies the rule logic.

      If the input does not match, null is returned.

      Specified by:
      matchAndApply in class Rule
      Parameters:
      input - the input Handler that wraps the Request
      Returns:
      an output Handler that wraps the input Handler, or null if the rule does not match
      Throws:
      IOException - if applying the rule fails
    • toString

      public String toString()
      Overrides:
      toString in class Rule
    • getWildCardLanguages

      protected List<String> getWildCardLanguages()
    • newLanguageHandler

      protected Rule.Handler newLanguageHandler(Rule.Handler input, String languagePathInContext, String language)