getBaseUri.
All methods throw java.lang.IllegalStateException
if called outside the scope of a request (e.g. from a provider constructor).
Context
| Modifier and Type | Method and Description |
|---|---|
| public URI | |
| public UriBuilder | Returns: a UriBuilder initialized with the absolute path of the request.Get the absolute path of the request in the form of a UriBuilder. |
| public URI | |
| public UriBuilder | Returns: a UriBuilder initialized with the base URI of the application.Get the base URI of the application in the form of a UriBuilder. |
| public List | Returns: a read-only list of matched resource class instances.Get a read-only list of the currently matched resource class instances. |
| public List | Returns: a read-only list of URI paths for matched resources.Get a read-only list of URIs for matched resources. |
| public List | Returns: a read-only list of URI paths for matched resources.controls whether sequences of escaped octets are decoded
( decode)true) or not (false).Get a read-only list of URIs for matched resources. |
| public String | Returns: the relative URI path.Get the path of the current request relative to the base URI as a string. |
| public String | Returns: the relative URI pathcontrols whether sequences of escaped octets are decoded
( decode)true) or not (false).Get the path of the current request relative to the base URI as a string. |
| public MultivaluedMap | Returns: an unmodifiable map of parameter names and values.Get the values of any embedded URI template parameters. |
| public MultivaluedMap | Returns: an unmodifiable map of parameter names and valuescontrols whether sequences of escaped octets are decoded
( decode)true) or not (false).Get the values of any embedded URI template parameters. |
| public List | Returns: an unmodifiable list ofPathSegment. The matrix parameter
map of each path segment is also unmodifiable.Get the path of the current request relative to the base URI as a
list of |
| public List | Returns: an unmodifiable list ofPathSegment. The matrix parameter
map of each path segment is also unmodifiable.controls whether sequences of escaped octets in path segments
and matrix parameter values are decoded ( decode)true) or not (false).Get the path of the current request relative to the base URI as a list of
|
| public MultivaluedMap | Returns: an unmodifiable map of query parameter names and values.Get the URI query parameters of the current request. |
| public MultivaluedMap | Returns: an unmodifiable map of query parameter names and values.controls whether sequences of escaped octets in parameter
names and values are decoded ( decode)true) or not (false).Get the URI query parameters of the current request. |
| public URI | Returns: the absolute request URIGet the absolute request URI including any query parameters. |
| public UriBuilder | Returns: a UriBuilder initialized with the absolute request URI.Get the absolute request URI in the form of a UriBuilder. |
| public URI | Returns: newly relativized URI.URI to relativize against the request URI. uri)Relativize a URI with respect to the current request URI. |
| public URI |
| getAbsolutePath | back to summary |
|---|---|
| public URI getAbsolutePath() Get the absolute path of the request. This includes everything preceding
the path (host, port etc) but excludes query parameters.
This is a shortcut for
| |
| getAbsolutePathBuilder | back to summary |
|---|---|
| public UriBuilder getAbsolutePathBuilder() Get the absolute path of the request in the form of a UriBuilder. This includes everything preceding the path (host, port etc) but excludes query parameters.
| |
| getBaseUri | back to summary |
|---|---|
| public URI getBaseUri() Get the base URI of the application. URIs of root resource classes are all relative to this base URI.
| |
| getBaseUriBuilder | back to summary |
|---|---|
| public UriBuilder getBaseUriBuilder() Get the base URI of the application in the form of a UriBuilder.
| |
| getMatchedResources | back to summary | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public List Get a read-only list of the currently matched resource class instances. Each entry is a resource class instance that matched the request URI either directly or via a sub-resource method or a sub-resource locator. Entries are ordered according to reverse request URI matching order, with the current resource first. E.g. given the following resource classes: @Path("foo")
public class FooResource {
@GET
public String getFoo() {...}
@Path("bar")
public BarResource getBarResource() {...}
}
public class BarResource {
@GET
public String getBar() {...}
}
The values returned by this method based on request uri and where the method is called from are:
| |||||||||||||
| getMatchedURIs | back to summary | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public List Get a read-only list of URIs for matched resources.
Each entry is a relative URI that matched a resource class, a
sub-resource method or a sub-resource locator. All sequences of escaped
octets are decoded, equivalent to @Path("foo")
public class FooResource {
@GET
public String getFoo() {...}
@Path("bar")
public BarResource getBarResource() {...}
}
public class BarResource {
@GET
public String getBar() {...}
}
The values returned by this method based on request uri and where the method is called from are:
| |||||||||||||
| getMatchedURIs | back to summary |
|---|---|
| public List Get a read-only list of URIs for matched resources.
Each entry is a relative URI that matched a resource class, a sub-resource
method or a sub-resource locator. Entries do not include query
parameters but do include matrix parameters if present in the request URI.
Entries are ordered in reverse request URI matching order, with the
current resource URI first. See | |
| getPath | back to summary |
|---|---|
| public String getPath() Get the path of the current request relative to the base URI as a string.
All sequences of escaped octets are decoded, equivalent to
| |
| getPath | back to summary |
|---|---|
| public String getPath(boolean decode) Get the path of the current request relative to the base URI as a string.
| |
| getPathParameters | back to summary |
|---|---|
| public MultivaluedMap Get the values of any embedded URI template parameters. All sequences of
escaped octets are decoded, equivalent to
| |
| getPathParameters | back to summary |
|---|---|
| public MultivaluedMap Get the values of any embedded URI template parameters.
| |
| getPathSegments | back to summary |
|---|---|
| public List Get the path of the current request relative to the base URI as a
list of
| |
| getPathSegments | back to summary |
|---|---|
| public List Get the path of the current request relative to the base URI as a list of
| |
| getQueryParameters | back to summary |
|---|---|
| public MultivaluedMap Get the URI query parameters of the current request. The map keys are the
names of the query parameters with any escaped characters decoded. All sequences
of escaped octets in parameter names and values are decoded, equivalent to
| |
| getQueryParameters | back to summary |
|---|---|
| public MultivaluedMap Get the URI query parameters of the current request. The map keys are the names of the query parameters with any escaped characters decoded.
| |
| getRequestUri | back to summary |
|---|---|
| public URI getRequestUri() Get the absolute request URI including any query parameters.
| |
| getRequestUriBuilder | back to summary |
|---|---|
| public UriBuilder getRequestUriBuilder() Get the absolute request URI in the form of a UriBuilder.
| |
| relativize | back to summary |
|---|---|
| public URI relativize(URI uri) Relativize a URI with respect to the current request URI. Relativization works as follows:
Examples (for base URI In the second example, the supplied URI is returned given that it is absolute and there is no common prefix between it and the request URI.
| |
| resolve | back to summary |
|---|---|
| public URI resolve(URI uri) Resolve a relative URI with respect to the base URI of the application. The resolved URI returned by this method is normalized. If the supplied URI is already resolved, it is just returned. | |