Search in sources :

Example 1 with OPTIONS

use of javax.ws.rs.OPTIONS in project stanbol by apache.

the class ReferencedSiteRootResource method handleCorsPreflightEntity.

@OPTIONS
@Path("/entity")
public Response handleCorsPreflightEntity(@PathParam(value = "site") String siteId, @Context HttpHeaders headers) {
    Site site = getSite(siteId);
    ResponseBuilder res = Response.ok();
    if (site instanceof ManagedSite) {
    //enableCORS(servletContext, res, headers, OPTIONS,GET,POST,PUT,DELETE);
    } else {
    //enableCORS(servletContext, res, headers,OPTIONS,GET);
    }
    return res.build();
}
Also used : ManagedSite(org.apache.stanbol.entityhub.servicesapi.site.ManagedSite) Site(org.apache.stanbol.entityhub.servicesapi.site.Site) ResponseBuilder(javax.ws.rs.core.Response.ResponseBuilder) ManagedSite(org.apache.stanbol.entityhub.servicesapi.site.ManagedSite) Path(javax.ws.rs.Path) EntityhubLDPath(org.apache.stanbol.entityhub.ldpath.EntityhubLDPath) OPTIONS(javax.ws.rs.OPTIONS)

Aggregations

OPTIONS (javax.ws.rs.OPTIONS)1 Path (javax.ws.rs.Path)1 ResponseBuilder (javax.ws.rs.core.Response.ResponseBuilder)1 EntityhubLDPath (org.apache.stanbol.entityhub.ldpath.EntityhubLDPath)1 ManagedSite (org.apache.stanbol.entityhub.servicesapi.site.ManagedSite)1 Site (org.apache.stanbol.entityhub.servicesapi.site.Site)1