public class URLUtil extends Object
| Constructor and Description |
|---|
URLUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
addXsrfToken(String token,
String url)
Adds a token to a given url in the FIRST position
|
static boolean |
compareURLStrings(String controlLink,
String testLink)
Compares 2 URL strings for equality.
|
static String |
decode(String urlParam)
The opposite of
encode(String) |
static String |
encode(String urlParam)
Can be called to encode a parameter part of an URL
|
static String |
getQueryParamValueFromUrl(String url,
String paramName) |
static String |
getQueryParamValueFromUrl(URL url,
String paramName) |
public static boolean compareURLStrings(String controlLink, String testLink)
For example: ViewWorkflowSteps.jspa?workflowMode=live&workflowName=Dude AND /jira/ViewWorkflowSteps.jspa?workflowName=Dude&workflowMode=live are deemed to be equal by this method.
Amazingly enough I couldn't find an open source helper that already does this!
controlLink - The link assumed to be correct.testLink - The link being tested.public static String getQueryParamValueFromUrl(String url, String paramName)
url - the url to process e.g. http://www.atlassian.com/search?blablabla=haha&test=twoparamName - the name of the parameter to retrieve the value ofpublic static String getQueryParamValueFromUrl(URL url, String paramName)
url - the url to processparamName - the name of the parameter to retrieve the value ofpublic static String addXsrfToken(String token, String url)
token - the tokenurl - the url in questionpublic static String encode(String urlParam)
urlParam - the parameter to be plaved into a URLpublic static String decode(String urlParam)
encode(String)urlParam - the param to decodeCopyright © 2002-2019 Atlassian. All Rights Reserved.