java.lang.Object
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 Details

    • ParsedURL

      public ParsedURL(String url)
      Construct a parsed URL
      Parameters:
      url - String
  • Method Details

    • 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)