Class ContainerUtils
- java.lang.Object
-
- org.glassfish.jersey.server.internal.ContainerUtils
-
public class ContainerUtils extends Object
Utility methods used by container implementations.- Author:
- Adam Lindenthal
-
-
Constructor Summary
Constructors Constructor Description ContainerUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
encodeUnsafeCharacters(String originalQueryString)
Encodes (predefined subset of) unsafe/unwise URI characters with the percent-encoding.static String
getHandlerPath(String uri)
Splits URI address from query params and returns it.static String
reduceLeadingSlashes(String path)
Reduces the number of slashes before the path to only one slash.
-
-
-
Method Detail
-
encodeUnsafeCharacters
public static String encodeUnsafeCharacters(String originalQueryString)
Encodes (predefined subset of) unsafe/unwise URI characters with the percent-encoding.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.
- Parameters:
originalQueryString
- URI query string (the part behind the question mark character).- Returns:
- the same string with unsafe characters percent encoded.
-
reduceLeadingSlashes
public static String reduceLeadingSlashes(String path)
Reduces the number of slashes before the path to only one slash.- Parameters:
path
- path string- Returns:
- path string with reduced slashes to only one.
-
-