Search in sources :

Example 1 with RESTResource

use of org.eclipse.smarthome.io.rest.RESTResource in project smarthome by eclipse.

the class RootResource method getRootBean.

private RootBean getRootBean() {
    RootBean bean = new RootBean();
    for (RESTResource resource : restResources) {
        // we will include all RESTResources that are currently satisfied
        if (resource.isSatisfied()) {
            String path = resource.getClass().getAnnotation(Path.class).value();
            bean.links.add(new RootBean.Links(path, uriInfo.getBaseUriBuilder().path(path).build().toASCIIString()));
        }
    }
    return bean;
}
Also used : Path(javax.ws.rs.Path) RootBean(org.eclipse.smarthome.io.rest.internal.resources.beans.RootBean) RESTResource(org.eclipse.smarthome.io.rest.RESTResource)

Aggregations

Path (javax.ws.rs.Path)1 RESTResource (org.eclipse.smarthome.io.rest.RESTResource)1 RootBean (org.eclipse.smarthome.io.rest.internal.resources.beans.RootBean)1