use of javax.ws.rs.core.CacheControl in project jersey by jersey.
the class CacheControlOn404Resource method get404.
@GET
public Response get404() {
CacheControl cc = new CacheControl();
cc.setMaxAge(10);
return Response.status(Response.Status.NOT_FOUND).cacheControl(cc).type("text/plain").entity("404 Not Found").build();
}
use of javax.ws.rs.core.CacheControl in project stanbol by apache.
the class UserResource method storeRole.
private Response storeRole(GraphNode roleNode, UriInfo uriInfo, String roleName, String comment, List<String> permissions) {
BlankNodeOrIRI roleResource = (BlankNodeOrIRI) roleNode.getNode();
if (permissions != null) {
clearPermissions(roleResource);
Lock writeLock = systemGraph.getLock().writeLock();
writeLock.lock();
try {
for (int i = 0; i < permissions.size(); i++) {
permissions.set(i, permissions.get(i).trim());
if (!permissions.get(i).equals("")) {
addPermission(roleNode, permissions.get(i));
}
}
} finally {
writeLock.unlock();
}
}
//refresh the policy so it will recheck the permissions
Policy.getPolicy().refresh();
// showSystem();
URI pageUri = uriInfo.getBaseUriBuilder().path("system/console/usermanagement").build();
// header Cache-control: no-cache, just in case intermediaries are
// holding onto old stuff
CacheControl cc = new CacheControl();
cc.setNoCache(true);
// the jax-rs things available
return Response.seeOther(pageUri).cacheControl(cc).build();
}
Aggregations