public class

ParsedURL

extends Object
java.lang.Object
   ↳ com.atlassian.jira.functest.framework.util.url.ParsedURL

Class Overview

A class that can parse and normalise a URL and its parameters

Summary

Public Constructors
ParsedURL(String url)
Construct a parsed URL
Public Methods
String getFile()
Gets the file name of this URL.
String getHost()
Gets the host name of this URL
List<String> getMultiQueryParameter(String name)
Map<StringList<String>> getMultiQueryParameters()
Map<StringList<String>> getMultiQueryParameters(String... names)
Map<StringList<String>> getMultiQueryParametersIgnoring(String... names)
String getPath()
Gets the path part of this URL.
int getPort()
Gets the port number of this URL.
String getProtocol()
Gets the protocol name of this URL.
String getQuery()
Gets the query part of this URL.
String getQueryParameter(String name)
Map<StringString> getQueryParameters()
Map<StringString> getQueryParameters(String... names)
Map<StringString> getQueryParametersIgnoring(String... names)
String toString()
Returns the URL in full string form
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ParsedURL (String url)

Construct a parsed URL

Parameters
url String

Public Methods

public String getFile ()

Gets the file name of this URL. The returned file portion will be the same as getPath(), plus the concatenation of the value of getQuery(), if any. If there is no query portion, this method and getPath() will return identical results.

Returns
  • the file name of this URL, or an empty string if one does not exist

public String getHost ()

Gets the host name of this URL

Returns
  • the host name of this URL.

public List<String> getMultiQueryParameter (String name)

public Map<StringList<String>> getMultiQueryParameters ()

public Map<StringList<String>> getMultiQueryParameters (String... names)

public Map<StringList<String>> getMultiQueryParametersIgnoring (String... names)

public String getPath ()

Gets the path part of this URL.

Returns
  • the path part of this URL, or an empty string if one does not exist

public int getPort ()

Gets the port number of this URL.

Returns
  • the port number, or -1 if the port is not set

public String getProtocol ()

Gets the protocol name of this URL.

Returns
  • the protocol of this URL.

public String getQuery ()

Gets the query part of this URL.

Returns
  • the query part of this URL, or null if one does not exist

public String getQueryParameter (String name)

Returns
  • the values of the named query parameter

public Map<StringString> getQueryParameters ()

Returns
  • a map of the query parameters, sorted into parameter name order

public Map<StringString> getQueryParameters (String... names)

Parameters
names the query parameter names to include
Returns
  • a map of the only the named query parameters, sorted into parameter name order

public Map<StringString> getQueryParametersIgnoring (String... names)

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

public String toString ()

Returns the URL in full string form

Returns
  • String