Package org.apache.wicket.request
Class UrlUtils
- java.lang.Object
-
- org.apache.wicket.request.UrlUtils
-
public class UrlUtils extends java.lang.ObjectVarious url utilities- Author:
- igor.vaynberg
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedUrlUtils()Constructor
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisRelative(java.lang.String url)Checks if the url is relative or absolutestatic java.lang.StringnormalizePath(java.lang.String path)Makes sure the path starts with a slash and does not end with a slash.static java.lang.StringrewriteToContextRelative(java.lang.String url, IRequestCycle requestCycle)Rewrites a relative url to be context relative, leaves absolute urls same.
-
-
-
Method Detail
-
isRelative
public static boolean isRelative(java.lang.String url)
Checks if the url is relative or absolute- Parameters:
url-- Returns:
trueif url is relative,falseotherwise
-
rewriteToContextRelative
public static java.lang.String rewriteToContextRelative(java.lang.String url, IRequestCycle requestCycle)Rewrites a relative url to be context relative, leaves absolute urls same.- Parameters:
url-requestCycle-- Returns:
- rewritten url
-
normalizePath
public static java.lang.String normalizePath(java.lang.String path)
Makes sure the path starts with a slash and does not end with a slash. Empty or null paths are normalized into an empty string.- Parameters:
path- path to normalize- Returns:
- normalized path
-
-