| java.lang.Object | |
| ↳ | com.atlassian.bitbucket.rest.util.RestUtils |
Helper functions and constants for REST.
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| String | APPLICATION_JSON_UTF8 | ||||||||||
| String | CHARSET_PREFIX | ||||||||||
| String | CHARSET_UTF8 | ||||||||||
| String | CONTENT_TYPE | ||||||||||
| String | DEFAULT_ENTITY_VERSION | ||||||||||
| String | DEFAULT_LIMIT | ||||||||||
| int | DEFAULT_RECENT_REPOS_LIMIT | ||||||||||
| String | DEFAULT_START | ||||||||||
| String | TEXT_HTML_UTF8 | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
If
from is non-null, return the result of apply(T). | |||||||||||
Conditionally handle gets where the request may include
If-Last-Modified headers. | |||||||||||
Gets the charset of a request.
| |||||||||||
Extracts avatar-related query parameters from the provided options map (usually passed in to the to_json Soy call)
describing them.
| |||||||||||
Extracts avatar-related query parameters from the provided
HttpRequestContext, if present, and returns
an AvatarRequest describing them. | |||||||||||
Extracts avatar-related query parameters from the provided
ContainerRequest, if present, and returns an
AvatarRequest describing them. | |||||||||||
Extracts paging-related query parameters from the provided
UriInfo and returns a PageRequest
describing them. | |||||||||||
Extracts paging-related query parameters from the provided
UriInfo and returns a PageRequest
describing them. | |||||||||||
Extracts markup rendering query parameters from the provided
HttpRequestContext and returns a
RenderContext describing them. | |||||||||||
Throws a NotFoundException if the value is null, otherwise return the value.
| |||||||||||
Correctly handles setting the content and response headers for an CacheableAvatarSupplier.
| |||||||||||
Processes each entity, walking through common Iterable containers and invoking
processCallback on the children. | |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
If from is non-null, return the result of apply(T). Otherwise return null.
Conditionally handle gets where the request may include If-Last-Modified headers.
| request | current request |
|---|---|
| lastUpdate | time when this entity was last updated |
| okFunction | will be called with response builder if this is a fresh request;
should most likely be calling entity(Object). |
Last-Modified header
Gets the charset of a request.
Note: Nullability for the return value is intentionally not documented one way or another. It is expected that the caller will know the nullability based on the default they are passing and code accordingly.
| request | request to introspect |
|---|---|
| defaultCharset | default charset to use if none is found or if the charset is not supported |
defaultCharset if none is found or if the charset is not supported
Extracts avatar-related query parameters from the provided options map (usually passed in to the to_json Soy call) describing them. If avatar parameters are not found a default request is returned.
| requestManager | the manager of the current request |
|---|---|
| options | the options supplied to the to_json call |
Extracts avatar-related query parameters from the provided HttpRequestContext, if present, and returns
an AvatarRequest describing them. If "avatarSize" was not specified, null is returned
to indicate avatars were not requested.
| request | the request to parse query parameters for |
|---|
null if avatars were not requested| BadRequestException | if "avatarSize" was set but could not be parsed as an int, or if
the specified size was less than or equal to 0 |
|---|
Extracts avatar-related query parameters from the provided ContainerRequest, if present, and returns an
AvatarRequest describing them. If "avatarSize" was not specified, null is returned to
indicate avatars were not requested.
| request | the request to parse query parameters for |
|---|
null if avatars were not requested| BadRequestException | if "avatarSize" was set but could not be parsed as an int, or if
the specified size was less than or equal to 0
|
|---|
Extracts paging-related query parameters from the provided UriInfo and returns a PageRequest
describing them. If paging parameters are not found, default parameters are assumed. The provided
defaultLimit will be used if no explicit limit is found as a query parameter.
This method will never return null.
| request | the request to parse query parameters for |
|---|---|
| defaultLimit | the limit to apply if no explicit limit has been specified |
Extracts paging-related query parameters from the provided UriInfo and returns a PageRequest
describing them. If paging parameters are not found, default parameters are assumed.
This method will never return null.
| request | the request to parse query parameters for |
|---|
Extracts markup rendering query parameters from the provided HttpRequestContext and returns a
RenderContext describing them. For any rendering parameters which are not explicitly configured,
the returned context will not have a value set and system-level defaults will be used.
This method will never return null.
| request | the request to parse query parameters for |
|---|
| BadRequestException | if "urlMode" was set but could not be parsed as a UrlMode |
|---|
Throws a NotFoundException if the value is null, otherwise return the value.
| NotFoundException |
|---|
Correctly handles setting the content and response headers for an CacheableAvatarSupplier.
| request | current request |
|---|---|
| cacheControl | which may be different depending on the URL |
| supplier | the avatar to send to the client |
Processes each entity, walking through common Iterable containers and invoking processCallback on the children.