Class ServerUtils

    • Method Detail

      • setAcceptableType

        @NotNull
        public static jakarta.ws.rs.core.Response.ResponseBuilder setAcceptableType​(@NotNull
                                                                                    jakarta.ws.rs.core.Response.ResponseBuilder response,
                                                                                    @NotNull
                                                                                    List<jakarta.ws.rs.core.MediaType> acceptableTypes)
        Sets the appropriate response content type while taking the accept header into account.
        Parameters:
        response - The response builder.
        acceptableTypes - The list of acceptable types from Request.getAcceptableMediaTypes.
        Returns:
        The response builder.
      • encodeTemplateNames

        @NotNull
        public static String encodeTemplateNames​(@NotNull
                                                 String s)
        Encodes a string with template parameters name present, specifically the characters '{' and '}' will be percent-encoded.
        Parameters:
        s - the string with zero or more template parameter names
        Returns:
        the string with encoded template parameter names.