Package org.fcrepo.http.api
Class FedoraAcl
- java.lang.Object
-
- org.fcrepo.http.commons.AbstractResource
-
- org.fcrepo.http.api.FedoraBaseResource
-
- org.fcrepo.http.api.ContentExposingResource
-
- org.fcrepo.http.api.FedoraAcl
-
@Scope("request") @Path("/{path: (.+/)?}fcr:acl") public class FedoraAcl extends ContentExposingResource- Since:
- 4/20/18
- Author:
- lsitu, peichman
-
-
Field Summary
Fields Modifier and Type Field Description protected StringexternalPathprotected javax.ws.rs.core.Requestrequestprotected javax.servlet.http.HttpServletResponseservletResponseprotected javax.ws.rs.core.UriInfouriInfo-
Fields inherited from class org.fcrepo.http.api.ContentExposingResource
ACCEPT_DATETIME, context, createResourceService, deleteResourceService, etagService, extContentHandlerFactory, httpRdfService, namespaceRegistry, prefer, replacePropertiesService, resourceTripleService, RFC3230_SPLITTER, updatePropertiesService
-
Fields inherited from class org.fcrepo.http.api.FedoraBaseResource
dbTransactionExecutor, identifierConverter, resourceFactory, resourceHelper, securityContext, servletRequest, txManager
-
-
Constructor Summary
Constructors Constructor Description FedoraAcl()Default JAX-RS entry point
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.ResponsecreateFedoraWebacAcl(javax.ws.rs.core.MediaType requestContentType, InputStream requestBodyStream)PUT to create FedoraWebacACL resource.javax.ws.rs.core.ResponsedeleteObject()Deletes an object.protected StringexternalPath()static org.apache.jena.rdf.model.ModelgetDefaultAcl(String baseUri, Path customRootAcl)Retrieve the default root ACL from a user specified location if it exists, otherwise the one provided by Fedora will be used.javax.ws.rs.core.ResponsegetResource()GET to retrieve the ACL resource.javax.ws.rs.core.ResponseupdateSparql(InputStream requestBodyStream)PATCH to update an FedoraWebacACL resource using SPARQL-UPDATE-
Methods inherited from class org.fcrepo.http.api.ContentExposingResource
addCacheControlHeaders, addExternalContentHeaders, addLinkAndOptionsHttpHeaders, addResourceHttpHeaders, addTransactionHeaders, asNode, buildLink, checkCacheControlHeaders, checkForInsufficientStorageException, checksumURI, createUpdateResponse, evaluateRequestPreconditions, getBinaryContent, getBinaryResourceMediaType, getChildrenLimit, getContent, getResourceTriples, getSimpleContentType, getUri, hasLenientPreferHeader, hasRestrictedPath, isRdfContentType, parseDigestHeader, patchResourcewithSparql, reloadResource, resource, setVaryAndPreferenceAppliedHeaders, unpackLinks
-
Methods inherited from class org.fcrepo.http.api.FedoraBaseResource
doesResourceExist, doInDbTx, doInDbTxWithRetry, getFedoraResource, getUserPrincipal, identifierConverter, isGhostNode, transaction
-
-
-
-
Field Detail
-
request
@Context protected javax.ws.rs.core.Request request
-
servletResponse
@Context protected javax.servlet.http.HttpServletResponse servletResponse
-
uriInfo
@Context protected javax.ws.rs.core.UriInfo uriInfo
-
externalPath
@PathParam("path") protected String externalPath
-
-
Constructor Detail
-
FedoraAcl
public FedoraAcl()
Default JAX-RS entry point
-
-
Method Detail
-
createFedoraWebacAcl
@PUT public javax.ws.rs.core.Response createFedoraWebacAcl(@HeaderParam("Content-Type") javax.ws.rs.core.MediaType requestContentType, InputStream requestBodyStream)
PUT to create FedoraWebacACL resource.- Parameters:
requestContentType- The content type of the resource bodyrequestBodyStream- The request body as stream- Returns:
- the response for a request to create a Fedora WebAc acl
-
updateSparql
@Consumes("application/sparql-update") public javax.ws.rs.core.Response updateSparql(InputStream requestBodyStream) throws IOException, org.fcrepo.kernel.api.exception.ItemNotFoundExceptionPATCH to update an FedoraWebacACL resource using SPARQL-UPDATE- Parameters:
requestBodyStream- the request body stream- Returns:
- 204
- Throws:
IOException- if IO exception occurredorg.fcrepo.kernel.api.exception.ItemNotFoundException
-
externalPath
protected String externalPath()
- Specified by:
externalPathin classContentExposingResource
-
getResource
@GET @Produces({"text/turtle;charset=utf-8;qs=1.0","application/ld+json;qs=0.8","text/rdf+n3;charset=utf-8","text/n3;charset=utf-8","application/rdf+xml","application/n-triples","text/plain;charset=utf-8","application/x-turtle","text/html;charset=utf-8"}) public javax.ws.rs.core.Response getResource() throws IOException, org.fcrepo.kernel.api.exception.ItemNotFoundExceptionGET to retrieve the ACL resource.- Returns:
- a binary or the triples for the specified node
- Throws:
IOException- if IO exception occurredorg.fcrepo.kernel.api.exception.ItemNotFoundException
-
deleteObject
@DELETE public javax.ws.rs.core.Response deleteObject() throws org.fcrepo.kernel.api.exception.ItemNotFoundException
Deletes an object.- Returns:
- response
- Throws:
org.fcrepo.kernel.api.exception.ItemNotFoundException
-
getDefaultAcl
public static org.apache.jena.rdf.model.Model getDefaultAcl(String baseUri, Path customRootAcl)
Retrieve the default root ACL from a user specified location if it exists, otherwise the one provided by Fedora will be used.- Parameters:
baseUri- the URI of the default ACLcustomRootAcl- the path to a custom root acl to use, optional- Returns:
- Model the rdf model of the default root ACL
-
-