Class BambooRestUtils

java.lang.Object
com.atlassian.bamboo.rest.common.utils.BambooRestUtils

public class BambooRestUtils extends Object
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 Type
    Method
    Description
    static @NotNull javax.ws.rs.core.MediaType
    getResponseMediaType(@NotNull javax.ws.rs.container.ContainerRequestContext request)
    Returns MediaType 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)
    Returns MediaType to be used for creating response for the given request.
    static @NotNull javax.ws.rs.core.MultivaluedMap<String,String>
    resolveFormParams(javax.ws.rs.container.ContainerRequestContext containerRequestContext)
    Retrieve Form from ContainerRequestContext.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getResponseMediaType

      @NotNull public static @NotNull javax.ws.rs.core.MediaType getResponseMediaType(@NotNull @NotNull javax.ws.rs.container.ContainerRequestContext request)
      Returns MediaType 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)
      Returns MediaType to be used for creating response for the given request.
      Parameters:
      request - request object
      httpHeaders - 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)
      Retrieve Form from ContainerRequestContext. 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: