Package io.undertow.util
Class URLUtils
- java.lang.Object
-
- io.undertow.util.URLUtils
-
public class URLUtils extends java.lang.ObjectUtilities for dealing with URLs- Author:
- Stuart Douglas
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.Stringdecode(java.lang.String s, java.lang.String enc, boolean decodeSlash, boolean formEncoding, java.lang.StringBuilder buffer)Decodes a URL.static java.lang.Stringdecode(java.lang.String s, java.lang.String enc, boolean decodeSlash, java.lang.StringBuilder buffer)Decodes a URL.static java.lang.StringnormalizeSlashes(java.lang.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 voidparsePathParams(java.lang.String string, HttpServerExchange exchange, java.lang.String charset, boolean doDecode, int maxParameters)static voidparsePathParms(java.lang.String string, HttpServerExchange exchange, java.lang.String charset, boolean doDecode, int maxParameters)Deprecated.static voidparseQueryString(java.lang.String string, HttpServerExchange exchange, java.lang.String charset, boolean doDecode, int maxParameters)
-
-
-
Method Detail
-
parseQueryString
public static void parseQueryString(java.lang.String string, HttpServerExchange exchange, java.lang.String charset, boolean doDecode, int maxParameters) throws ParameterLimitException- Throws:
ParameterLimitException
-
parsePathParms
@Deprecated public static void parsePathParms(java.lang.String string, HttpServerExchange exchange, java.lang.String charset, boolean doDecode, int maxParameters) throws ParameterLimitExceptionDeprecated.- Throws:
ParameterLimitException
-
parsePathParams
public static void parsePathParams(java.lang.String string, HttpServerExchange exchange, java.lang.String charset, boolean doDecode, int maxParameters) throws ParameterLimitException- Throws:
ParameterLimitException
-
decode
public static java.lang.String decode(java.lang.String s, java.lang.String enc, boolean decodeSlash, java.lang.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
-
decode
public static java.lang.String decode(java.lang.String s, java.lang.String enc, boolean decodeSlash, boolean formEncoding, java.lang.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
-
normalizeSlashes
public static java.lang.String normalizeSlashes(java.lang.String path)
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
-
-