Class BambooRestUtils
java.lang.Object
com.atlassian.bamboo.rest.common.utils.BambooRestUtils
Utilities for Bamboo REST resources.
todo: this is used for exception mapping, move to plugin-rest-filters together with all common ExceptionMappers
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull javax.ws.rs.core.MediaType
getResponseMediaType
(@NotNull javax.ws.rs.container.ContainerRequestContext request) ReturnsMediaType
to be used for creating response for the given HTTP request.static @NotNull javax.ws.rs.core.MediaType
getResponseMediaType
(@NotNull javax.ws.rs.container.ContainerRequestContext request, @NotNull List<javax.ws.rs.core.MediaType> acceptableMediaTypes) static @NotNull javax.ws.rs.core.MediaType
getResponseMediaType
(@NotNull javax.ws.rs.container.ContainerRequestContext request, @NotNull javax.ws.rs.core.HttpHeaders httpHeaders) ReturnsMediaType
to be used for creating response for the given request.resolveFormParams
(javax.ws.rs.container.ContainerRequestContext containerRequestContext) RetrieveForm
fromContainerRequestContext
.
-
Method Details
-
getResponseMediaType
@NotNull public static @NotNull javax.ws.rs.core.MediaType getResponseMediaType(@NotNull @NotNull javax.ws.rs.container.ContainerRequestContext request) ReturnsMediaType
to be used for creating response for the given HTTP request.- Parameters:
request
- request object- Returns:
- media type to use for response
-
getResponseMediaType
@NotNull public static @NotNull javax.ws.rs.core.MediaType getResponseMediaType(@NotNull @NotNull javax.ws.rs.container.ContainerRequestContext request, @NotNull @NotNull javax.ws.rs.core.HttpHeaders httpHeaders) ReturnsMediaType
to be used for creating response for the given request.- Parameters:
request
- request objecthttpHeaders
- headers of the request- Returns:
- media type to use for response
-
getResponseMediaType
@NotNull public static @NotNull javax.ws.rs.core.MediaType getResponseMediaType(@NotNull @NotNull javax.ws.rs.container.ContainerRequestContext request, @NotNull @NotNull List<javax.ws.rs.core.MediaType> acceptableMediaTypes) -
resolveFormParams
@NotNull public static @NotNull javax.ws.rs.core.MultivaluedMap<String,String> resolveFormParams(javax.ws.rs.container.ContainerRequestContext containerRequestContext) RetrieveForm
fromContainerRequestContext
. If servlet filter consumes Form, which is the case here, Jersey puts form parameters in ContainerRequestContext, so we have to retrieve it if REST is to handle "application/x-www-form-urlencoded" media type.- Parameters:
containerRequestContext
-- Returns:
-