Package org.somda.sdc.glue.common.helper
Class UrlUtf8
java.lang.Object
org.somda.sdc.glue.common.helper.UrlUtf8
Helper to encode and decode URLs to and from UTF-8.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringdecodePChars(String text) Accepts a text and decodes it as pchar according to RFC3986.static StringencodePChars(String text) Accepts a text and encodes it as valid pchar according to RFC3986.static StringencodePChars(String text, boolean escapeAmpersand) Accepts a text and encodes it as valid pchar according to RFC3986.
-
Constructor Details
-
UrlUtf8
public UrlUtf8()
-
-
Method Details
-
encodePChars
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
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
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.
-