Package org.somda.sdc.glue.common.helper
Class UrlUtf8
-
- All Implemented Interfaces:
public class UrlUtf8Helper to encode and decode URLs to and from UTF-8.
-
-
Constructor Summary
Constructors Constructor Description UrlUtf8()
-
Method Summary
Modifier and Type Method Description static StringencodePChars(@Nullable() String text)Accepts a text and encodes it as valid pchar according to RFC3986. static StringencodePChars(@Nullable() String text, boolean escapeAmpersand)Accepts a text and encodes it as valid pchar according to RFC3986. static StringdecodePChars(@Nullable() String text)Accepts a text and decodes it as pchar according to RFC3986. -
-
Method Detail
-
encodePChars
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
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.- Returns:
the encoded text or an empty string if text was null.
-
decodePChars
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.
-
-
-
-