Class UrlUtf8

java.lang.Object
org.somda.sdc.glue.common.helper.UrlUtf8

public class UrlUtf8 extends Object
Helper to encode and decode URLs to and from UTF-8.
  • Constructor Details

    • UrlUtf8

      public UrlUtf8()
  • Method Details

    • encodePChars

      public static String encodePChars(@Nullable String text)
      Accepts a text and encodes it as valid pchar according to RFC3986.
      Parameters:
      text - the text to encode.
      Returns:
      the encoded text or an empty string if text was null.
    • encodePChars

      public static String encodePChars(@Nullable String text, boolean escapeAmpersand)
      Accepts a text and encodes it as valid pchar according to RFC3986.
      Parameters:
      text - the text to encode.
      escapeAmpersand - percent-encode ampersands (&) in the text. This is required when the context already uses ampersands as a delimiter, such as in the queries for location context query transformation
      Returns:
      the encoded text or an empty string if text was null.
    • decodePChars

      public static String decodePChars(@Nullable String text)
      Accepts a text and decodes it as pchar according to RFC3986.
      Parameters:
      text - the text to decode.
      Returns:
      the encoded text or an empty string if text was null.