public class ContainerUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String[] |
REPLACEMENTS |
private static java.lang.String[] |
TOKENS |
Constructor and Description |
---|
ContainerUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
encodeUnsafeCharacters(java.lang.String originalQueryString)
Encodes (predefined subset of) unsafe/unwise URI characters with the percent-encoding.
|
static java.lang.String |
getHandlerPath(java.lang.String uri)
Splits URI address from query params and returns it.
|
static java.lang.String |
reduceLeadingSlashes(java.lang.String path)
Reduces the number of slashes before the path to only one slash.
|
private static final java.lang.String[] TOKENS
private static final java.lang.String[] REPLACEMENTS
public static java.lang.String encodeUnsafeCharacters(java.lang.String originalQueryString)
Replaces the predefined set of unsafe URI characters in the query string with its percent-encoded counterparts. The reserved characters (as defined by the RFC) are automatically encoded by browsers, but some characters are in the "gray zone" - are not explicitly forbidden, but not recommended and known to cause issues.
originalQueryString
- URI query string (the part behind the question mark character).public static java.lang.String reduceLeadingSlashes(java.lang.String path)
path
- path stringpublic static java.lang.String getHandlerPath(java.lang.String uri)
uri
- URI address in string format with query params