Class CreatedResponseUtil


  • public class CreatedResponseUtil
    extends Object
    A Utility class that parses the Response object into the underlying ID attribute
    Author:
    John D. Ament, Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc.
    • Constructor Detail

      • CreatedResponseUtil

        public CreatedResponseUtil()
    • Method Detail

      • getCreatedId

        public static String getCreatedId​(javax.ws.rs.core.Response response)
                                   throws javax.ws.rs.WebApplicationException
        Reads the Response object, confirms that it returns a 201 created and parses the ID from the location It always assumes the ID is the last segment of the URI
        Parameters:
        response - The JAX-RS Response received
        Returns:
        The String ID portion of the URI
        Throws:
        javax.ws.rs.WebApplicationException - if the response is not a 201 Created