use of org.keycloak.services.resource.RealmResourceProvider in project keycloak by keycloak.
the class RealmsResource method resolveRealmExtension.
/**
* A JAX-RS sub-resource locator that uses the {@link org.keycloak.services.resource.RealmResourceSPI} to resolve sub-resources instances given an <code>unknownPath</code>.
*
* @param extension a path that could be to a REST extension
* @return a JAX-RS sub-resource instance for the REST extension if found. Otherwise null is returned.
*/
@Path("{realm}/{extension}")
public Object resolveRealmExtension(@PathParam("realm") String realmName, @PathParam("extension") String extension) {
init(realmName);
RealmResourceProvider provider = session.getProvider(RealmResourceProvider.class, extension);
if (provider != null) {
Object resource = provider.getResource();
if (resource != null) {
return resource;
}
}
throw new NotFoundException();
}
Aggregations