Class ParsedURL
java.lang.Object
com.atlassian.jira.functest.framework.util.url.ParsedURL
A class that can parse and normalise a URL and its parameters
- Since:
- v4.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFile()
Gets the file name of thisURL
.getHost()
Gets the host name of thisURL
getMultiQueryParameter
(String name) getMultiQueryParameters
(String... names) getMultiQueryParametersIgnoring
(String... names) getPath()
Gets the path part of thisURL
.int
getPort()
Gets the port number of thisURL
.Gets the protocol name of thisURL
.getQuery()
Gets the query part of thisURL
.getQueryParameter
(String name) getQueryParameters
(String... names) getQueryParametersIgnoring
(String... names) toString()
Returns the URL in full string form
-
Constructor Details
-
ParsedURL
Construct a parsed URL- Parameters:
url
- String
-
-
Method Details
-
toString
Returns the URL in full string form -
getProtocol
Gets the protocol name of thisURL
.- Returns:
- the protocol of this
URL
.
-
getHost
Gets the host name of thisURL
- Returns:
- the host name of this
URL
.
-
getPort
public int getPort()Gets the port number of thisURL
.- Returns:
- the port number, or -1 if the port is not set
-
getFile
Gets the file name of thisURL
. The returned file portion will be the same asgetPath()
, plus the concatenation of the value ofgetQuery()
, if any. If there is no query portion, this method andgetPath()
will return identical results.- Returns:
- the file name of this
URL
, or an empty string if one does not exist
-
getPath
Gets the path part of thisURL
.- Returns:
- the path part of this
URL
, or an empty string if one does not exist
-
getQuery
Gets the query part of thisURL
.- Returns:
- the query part of this
URL
, ornull
if one does not exist
-
getQueryParameters
- Returns:
- a map of the query parameters, sorted into parameter name order
-
getQueryParameters
- Parameters:
names
- the query parameter names to include- Returns:
- a map of the only the named query parameters, sorted into parameter name order
-
getQueryParametersIgnoring
- Parameters:
names
- the query parameter names to ignore- Returns:
- a map of the only the named query parameters ignoring the specified keys, sorted into parameter name order
-
getQueryParameter
- Returns:
- the values of the named query parameter
-
getMultiQueryParameters
-
getMultiQueryParameters
-
getMultiQueryParametersIgnoring
-
getMultiQueryParameter
-