public class UrlUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static URI |
extractNewUrl(String currentUrl,
String href) |
static String |
getBaseUrl(String url) |
static String |
getVarFromQueryString(String varName,
String haystack)
Retrieve the var value for varName from a HTTP query string (format is
"var1=val1&var2=val2").
|
static boolean |
isSameDomain(String currentUrl,
URI url)
Checks if the given URL is part of the domain, or a subdomain of the given
URI. |
public static URI extractNewUrl(String currentUrl, String href)
currentUrl - The current urlhref - The target URL, relative or notpublic static String getBaseUrl(String url)
url - the URL string. It must contain with ":" e.g, http: or https:public static String getVarFromQueryString(String varName, String haystack)
varName - the name.haystack - the haystack.Copyright © 2007–2014. All rights reserved.