Package io.undertow.util
Class URLUtils
- java.lang.Object
-
- io.undertow.util.URLUtils
-
public class URLUtils extends Object
Utilities for dealing with URLs- Author:
- Stuart Douglas, Andre Schaefer
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Stringdecode(String s, String enc, boolean decodeSlash, boolean formEncoding, StringBuilder buffer)Decodes a URL.static Stringdecode(String s, String enc, boolean decodeSlash, StringBuilder buffer)Decodes a URL.static booleangetSlashDecodingFlag(boolean allowEncodedSlash, Boolean decodeSlash)static booleangetSlashDecodingFlag(org.xnio.OptionMap options)static booleanisAbsoluteUrl(String location)Test if provided location is an absolute URI or not.static StringnormalizeSlashes(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 intparsePathParams(String string, HttpServerExchange exchange, String charset, boolean doDecode, int maxParameters)static voidparsePathParms(String string, HttpServerExchange exchange, String charset, boolean doDecode, int maxParameters)Deprecated.static voidparseQueryString(String string, HttpServerExchange exchange, String charset, boolean doDecode, int maxParameters)
-
-
-
Method Detail
-
parseQueryString
public static void parseQueryString(String string, HttpServerExchange exchange, String charset, boolean doDecode, int maxParameters) throws ParameterLimitException
- Throws:
ParameterLimitException
-
parsePathParms
@Deprecated public static void parsePathParms(String string, HttpServerExchange exchange, String charset, boolean doDecode, int maxParameters) throws ParameterLimitException
Deprecated.- Throws:
ParameterLimitException
-
parsePathParams
public static int parsePathParams(String string, HttpServerExchange exchange, String charset, boolean doDecode, int maxParameters) throws ParameterLimitException
- Throws:
ParameterLimitException
-
decode
public static String decode(String s, String enc, boolean decodeSlash, 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 String decode(String s, String 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
-
normalizeSlashes
public 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.- Parameters:
path- the path to normalize- Returns:
- a normalized (with respect to slashes) result
-
isAbsoluteUrl
public static boolean isAbsoluteUrl(String location)
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
-
getSlashDecodingFlag
public static boolean getSlashDecodingFlag(org.xnio.OptionMap options)
-
getSlashDecodingFlag
public static boolean getSlashDecodingFlag(boolean allowEncodedSlash, Boolean decodeSlash)
-
-