Class RestUtils

org.elasticsearch.rest.RestUtils

public class RestUtils extends
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static
     corsSetting)
    Determine if CORS setting is a regex
    static []
     corsSetting)
    Return the CORS setting as an array of origins.
    static
     s)
    Decodes a bit of an URL encoded by a browser.
    static void
     s, int fromIndex, <,​> params)
     

    Methods inherited from class java.lang.

    , , , , , , , , , ,
  • Field Details

  • Constructor Details

    • RestUtils

      public RestUtils()
  • Method Details

    • decodeQueryString

      public static void decodeQueryString( s, int fromIndex, <,​> params)
    • decodeComponent

      public static  decodeComponent( s)
      Decodes a bit of an URL encoded by a browser.

      This is equivalent to calling decodeComponent(String, Charset, boolean) with the UTF-8 charset (recommended to comply with RFC 3986, Section 2).

      Parameters:
      s - The string to decode (can be empty).
      Returns:
      The decoded string, or s if there's nothing to decode. If the string to decode is null, returns an empty string.
      Throws:
      - if the string contains a malformed escape sequence.
    • checkCorsSettingForRegex

      public static  checkCorsSettingForRegex( corsSetting)
      Determine if CORS setting is a regex
      Returns:
      a corresponding if so and o.w. null.
    • corsSettingAsArray

      public static [] corsSettingAsArray( corsSetting)
      Return the CORS setting as an array of origins.
      Parameters:
      corsSetting - the CORS allow origin setting as configured by the user; should never pass null, but we check for it anyway.
      Returns:
      an array of origins if set, otherwise null.