com.atlassian.jira.functest.framework.util.url
Class ParsedURL

java.lang.Object
  extended by com.atlassian.jira.functest.framework.util.url.ParsedURL

public class ParsedURL
extends Object

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

Since:
v4.1

Constructor Summary
ParsedURL(String url)
          Construct a parsed URL
 
Method Summary
 String getFile()
          Gets the file name of this URL.
 String getHost()
          Gets the host name of this URL
 List<String> getMultiQueryParameter(String name)
           
 Map<String,List<String>> getMultiQueryParameters()
           
 Map<String,List<String>> getMultiQueryParameters(String... names)
           
 Map<String,List<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<String,String> getQueryParameters()
           
 Map<String,String> getQueryParameters(String... names)
           
 Map<String,String> getQueryParametersIgnoring(String... names)
           
 String toString()
          Returns the URL in full string form
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParsedURL

public ParsedURL(String url)
Construct a parsed URL

Parameters:
url - String
Method Detail

toString

public String toString()
Returns the URL in full string form

Overrides:
toString in class Object
Returns:
String

getProtocol

public String getProtocol()
Gets the protocol name of this URL.

Returns:
the protocol of this URL.

getHost

public String getHost()
Gets the host name of this URL

Returns:
the host name of this URL.

getPort

public int getPort()
Gets the port number of this URL.

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

getFile

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

getPath

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

getQuery

public String getQuery()
Gets the query part of this URL.

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

getQueryParameters

public Map<String,String> getQueryParameters()
Returns:
a map of the query parameters, sorted into parameter name order

getQueryParameters

public Map<String,String> 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

getQueryParametersIgnoring

public Map<String,String> 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

getQueryParameter

public String getQueryParameter(String name)
Returns:
the values of the named query parameter

getMultiQueryParameters

public Map<String,List<String>> getMultiQueryParameters()

getMultiQueryParameters

public Map<String,List<String>> getMultiQueryParameters(String... names)

getMultiQueryParametersIgnoring

public Map<String,List<String>> getMultiQueryParametersIgnoring(String... names)

getMultiQueryParameter

public List<String> getMultiQueryParameter(String name)


Copyright © 2002-2014 Atlassian. All Rights Reserved.