Package com.crawljax.util
Class UrlUtils
- java.lang.Object
-
- com.crawljax.util.UrlUtils
-
public class UrlUtils extends Object
-
-
Constructor Summary
Constructors Modifier Constructor Description privateUrlUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static URIextractNewUrl(String currentUrl, String href)static StringgetBaseUrl(String url)static StringgetVarFromQueryString(String varName, String haystack)Retrieve the var value for varName from a HTTP query string (format is "var1=val1&var2=val2").private static booleanisJavascript(String href)static booleanisSameDomain(String currentUrl, URI url)Checks if the given URL is part of the domain, or a sub-domain of the givenURI.
-
-
-
Method Detail
-
extractNewUrl
public static URI extractNewUrl(String currentUrl, String href)
- Parameters:
currentUrl- The current urlhref- The target URL, relative or not- Returns:
- The new URL.
-
isJavascript
private static boolean isJavascript(String href)
-
getBaseUrl
public static String getBaseUrl(String url)
- Parameters:
url- the URL string. It must contain with ":" e.g, http: or https:- Returns:
- the base part of the URL.
-
getVarFromQueryString
public static String getVarFromQueryString(String varName, String haystack)
Retrieve the var value for varName from a HTTP query string (format is "var1=val1&var2=val2").- Parameters:
varName- the name.haystack- the haystack.- Returns:
- variable value for varName
-
-