Class CreatedResponseUtil

java.lang.Object
org.keycloak.admin.client.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 Details

    • CreatedResponseUtil

      public CreatedResponseUtil()
  • Method Details

    • getCreatedId

      public static String getCreatedId(jakarta.ws.rs.core.Response response) throws jakarta.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:
      jakarta.ws.rs.WebApplicationException - if the response is not a 201 Created