Class URLUtils
java.lang.Object
org.jboss.resteasy.reactive.common.util.URLUtils
Utilities for dealing with URLs
- Author:
- Stuart Douglas, Andre Schaefer
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
decode
(String s, Charset enc, boolean decodeSlash, boolean formEncoding, StringBuilder buffer) Decodes a URL.static String
decode
(String s, Charset enc, boolean decodeSlash, StringBuilder buffer) Decodes a URL.static boolean
isAbsoluteUrl
(String location) Test if provided location is an absolute URI or not.static String
normalizeSlashes
(String path) Adds a '/' prefix to the beginning of a path if one isn't present and removes trailing slashes if any are present.static void
parsePathParameters
(String path, Set<String> pathParameters) Extract path param names out of a JAX-RS path.static int
parsePathParams
(String string, jakarta.ws.rs.core.MultivaluedMap<String, String> exchange, Charset charset, boolean doDecode, int maxParameters) static void
parsePathParms
(String string, jakarta.ws.rs.core.MultivaluedMap<String, String> exchange, Charset charset, boolean doDecode, int maxParameters) Deprecated.static void
parseQueryString
(String string, jakarta.ws.rs.core.MultivaluedMap<String, String> exchange, Charset charset, boolean doDecode, int maxParameters)
-
Method Details
-
parseQueryString
-
parsePathParms
@Deprecated public static void parsePathParms(String string, jakarta.ws.rs.core.MultivaluedMap<String, String> exchange, Charset charset, boolean doDecode, int maxParameters) Deprecated. -
parsePathParams
-
decode
Decodes a URL. If the decoding fails for any reason then an IllegalArgumentException will be thrown.- Parameters:
s
- The string to decodeenc
- The encodingdecodeSlash
- If slash characters should be decodedbuffer
- The string builder to use as a buffer.- Returns:
- The decoded URL
-
decode
public static String decode(String s, Charset enc, boolean decodeSlash, boolean formEncoding, StringBuilder buffer) Decodes a URL. If the decoding fails for any reason then an IllegalArgumentException will be thrown.- Parameters:
s
- The string to decodeenc
- The encodingdecodeSlash
- If slash characters should be decodedbuffer
- The string builder to use as a buffer.- Returns:
- The decoded URL
-
parsePathParameters
Extract path param names out of a JAX-RS path. Does not detect errors, but should be fast and correct if the input is correct. -
normalizeSlashes
Adds a '/' prefix to the beginning of a path if one isn't present and removes trailing slashes if any are present.- Parameters:
path
- the path to normalize- Returns:
- a normalized (with respect to slashes) result
-
isAbsoluteUrl
Test if provided location is an absolute URI or not.- Parameters:
location
- location to check, null = relative, having scheme = absolute- Returns:
- true if location is considered absolute
-