public final class Paths extends Object
Modifier and Type | Method and Description |
---|---|
static String |
addLeadingSlash(String path)
Add leading slash (if there is not already), returns the same value otherwise.
|
static List<String> |
getPathElements(String rawPath)
Converts a path into a list of URL-decoded path elements.
|
static String |
joinPath(List<String> elements)
Joins a list of URL-decoded path elements into a url-encoded path.
|
static String |
removeTrailingSlash(String path)
Removes trailing slash (if there is any), returns the same value otherwise.
|
static String |
urlDecode(Object value)
Returns the URL path decoding of the provided object's string
representation.
|
static String |
urlEncode(Object value)
Returns the URL path encoding of the provided object's string
representation.
|
public static String urlDecode(Object value)
value
- The value to be URL path decoded.public static String urlEncode(Object value)
value
- The value to be URL path encoded.public static List<String> getPathElements(String rawPath)
null
, ""
and "/"
will
all return an empty list, and "//"
will return a list with two elements, both
empty strings, as all intermediate and trailing empty paths are retained.rawPath
- The raw, URL-encoded path string.public static String joinPath(List<String> elements)
elements
- The list of (URL-decoded) elements.public static String removeTrailingSlash(String path)
path
- path with (possibly) trailing slashCopyright © 2025 Open Identity Platform Community. All rights reserved.