use of com.entwinemedia.fn.data.json.JString in project opencast by opencast.
the class BaseEndpoint method getEndpointInfo.
@GET
@Path("")
@Produces({ "application/json", "application/v1.0.0+json" })
@RestQuery(name = "getendpointinfo", description = "Returns key characteristics of the API such as the server name and the default version.", returnDescription = "", reponses = { @RestResponse(description = "The api information is returned.", responseCode = HttpServletResponse.SC_OK) })
public Response getEndpointInfo() {
Organization organization = securityService.getOrganization();
String orgExternalAPIUrl = organization.getProperties().get(OpencastConstants.EXTERNAL_API_URL_ORG_PROPERTY);
JString url;
if (StringUtils.isNotBlank(orgExternalAPIUrl)) {
url = v(orgExternalAPIUrl);
} else {
url = v(endpointBaseUrl);
}
JValue json = obj(f("url", url), f("version", v(ApiVersion.CURRENT_VERSION.toString())));
return RestUtil.R.ok(MediaType.APPLICATION_JSON_TYPE, serializer.toJson(json));
}
Aggregations