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 String
externalPath
protected javax.ws.rs.core.Request
request
protected javax.servlet.http.HttpServletResponse
servletResponse
protected javax.ws.rs.core.UriInfo
uriInfo
-
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
-
Fields inherited from class org.fcrepo.http.commons.AbstractResource
defaultPidMinter, fedoraPropsConfig, headers, pidMinter, versionService
-
-
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.Response
createFedoraWebacAcl(javax.ws.rs.core.MediaType requestContentType, InputStream requestBodyStream)
PUT to create FedoraWebacACL resource.javax.ws.rs.core.Response
deleteObject()
Deletes an object.protected String
externalPath()
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.javax.ws.rs.core.Response
getResource()
GET to retrieve the ACL resource.javax.ws.rs.core.Response
updateSparql(InputStream requestBodyStream)
PATCH to update an FedoraWebacACL resource using SPARQL-UPDATE-
Methods inherited from class org.fcrepo.http.api.ContentExposingResource
addCacheControlHeaders, addExternalContentHeaders, addLinkAndOptionsHttpHeaders, addResourceHttpHeaders, 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, ItemNotFoundException
PATCH to update an FedoraWebacACL resource using SPARQL-UPDATE- Parameters:
requestBodyStream
- the request body stream- Returns:
- 204
- Throws:
IOException
- if IO exception occurredItemNotFoundException
-
externalPath
protected String externalPath()
- Specified by:
externalPath
in 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","text/html;charset=utf-8"}) public javax.ws.rs.core.Response getResource() throws IOException, ItemNotFoundException
GET to retrieve the ACL resource.- Returns:
- a binary or the triples for the specified node
- Throws:
IOException
- if IO exception occurredItemNotFoundException
-
deleteObject
@DELETE public javax.ws.rs.core.Response deleteObject() throws ItemNotFoundException
Deletes an object.- Returns:
- response
- Throws:
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
-
-