org.idoox.transport
Interface URI

All Known Implementing Classes:
Endpoint

public interface URI

Uniform resource identifier. String like this one:


 (scheme)://(userinfo)@(host):(port)(context_path)(path)?(query)#(fragment)
                                                  \______ location _______/
 

See Also:
URI RFC 2396, URL RFC 1738
Component:
Core

Method Summary
 java.lang.String getContextPath()
          Gets context path.
 java.lang.String getFragment()
          Gets fragment.
 java.lang.String getHost()
          Gets host.
 java.lang.String getLocation()
          Gets location (path + query + fragment).
 java.lang.String getParameter(java.lang.String name)
          Gets query parameter value or null if the parameter does not exist.
 java.util.Set getParameterNames()
          Gets query parameters.
 java.lang.String[] getParameters(java.lang.String name)
          Returns an array of the values the given request parameter has, or null if the parameter does not exist.
 java.lang.String getPath()
          Gets path.
 int getPort()
          Gets port.
 java.lang.String getQuery()
          Gets query.
 java.lang.String getScheme()
          Gets scheme.
 java.lang.String getUserinfo()
          Gets userinfo.
 java.lang.String toExternalForm()
          Gets string representation of this URI.
 

Method Detail

getScheme

public java.lang.String getScheme()
Gets scheme.

Returns:
a scheme

getUserinfo

public java.lang.String getUserinfo()
Gets userinfo.

Returns:
an user info

getHost

public java.lang.String getHost()
Gets host.

Returns:
a host

getPort

public int getPort()
Gets port.

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

getContextPath

public java.lang.String getContextPath()
Gets context path. A location string is a relative path to this context if this one is not empty and not null.

Returns:
a context path

getLocation

public java.lang.String getLocation()
Gets location (path + query + fragment).

Returns:
a location

getPath

public java.lang.String getPath()
Gets path.

Returns:
a path

getFragment

public java.lang.String getFragment()
Gets fragment.

Returns:
a fragment

getQuery

public java.lang.String getQuery()
Gets query.

Returns:
a query string

getParameterNames

public java.util.Set getParameterNames()
Gets query parameters.

Returns:
a set of parameter names

getParameter

public java.lang.String getParameter(java.lang.String name)
Gets query parameter value or null if the parameter does not exist. If you use this method with a multivalued parameter, the value returned is equal to the first value in the array returned by getParameters.

Parameters:
name - a parameter name
Returns:
a parameter value

getParameters

public java.lang.String[] getParameters(java.lang.String name)
Returns an array of the values the given request parameter has, or null if the parameter does not exist. If the parameter has a single value, the array has a length of 1.

Parameters:
name - a parameter name
Returns:
an array of parameter's values

toExternalForm

public java.lang.String toExternalForm()
Gets string representation of this URI.

Returns:
URI like string