Package com.forgerock.util
Class Uris
java.lang.Object
com.forgerock.util.Uris
DO NOT USE: Internal utility class for performing operations on universal resource identifiers.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringDecodes a URL-encoded string, converting percent-encoded sequences back to their original characters.static StringurlDecodeFragment(String fragment) Decodes the provided URL encoded fragment as per RFC 3986.static StringURL encodes the provided string using the specified set of safe characters.static StringurlEncodeFragment(String fragment) URL encodes the provided fragment as per RFC 3986.
-
Method Details
-
urlDecodeFragment
Decodes the provided URL encoded fragment as per RFC 3986.- Parameters:
fragment- the URL encoded fragment, which may benull.- Returns:
- the decoded fragment, or
nulliffragmentwasnull.
-
urlEncodeFragment
URL encodes the provided fragment as per RFC 3986.- Parameters:
fragment- the fragment, which may benull.- Returns:
- the URL encoded fragment, or
nulliffragmentwasnull.
-
urlEncode
URL encodes the provided string using the specified set of safe characters. Characters not present in thesafeCharsset are percent-encoded as UTF-8 octets.- Parameters:
s- the string to encode, which may benull.safeChars- aBitSetrepresenting characters that do not require encoding.- Returns:
- the URL-encoded string, or
nullifswasnull.
-
urlDecode
Decodes a URL-encoded string, converting percent-encoded sequences back to their original characters. Optionally converts plus signs (+) to spaces ifdecodePlusToSpaceistrue.- Parameters:
s- the URL-encoded string to decode, which may benull.decodePlusToSpace- iftrue, plus signs will be decoded as spaces.- Returns:
- the decoded string, or
nullifswasnull. - Throws:
IllegalArgumentException- if the input contains incomplete or invalid percent-encoded sequences.
-