Package org.fcrepo.http.api
Class FedoraLdp
- java.lang.Object
-
- org.fcrepo.http.commons.AbstractResource
-
- org.fcrepo.http.api.FedoraBaseResource
-
- org.fcrepo.http.api.ContentExposingResource
-
- org.fcrepo.http.api.FedoraLdp
-
@Scope("request") @Path("/{path: .*}") public class FedoraLdp extends ContentExposingResource- Since:
- 9/25/14
- Author:
- cabeer, ajs6f
-
-
Field Summary
Fields Modifier and Type Field Description protected StringexternalPathprotected org.fcrepo.kernel.api.services.ReplaceBinariesServicereplaceBinariesService-
Fields inherited from class org.fcrepo.http.api.ContentExposingResource
ACCEPT_DATETIME, context, createResourceService, deleteResourceService, etagService, extContentHandlerFactory, httpRdfService, namespaceRegistry, prefer, replacePropertiesService, request, resourceTripleService, RFC3230_SPLITTER, servletResponse, updatePropertiesService
-
Fields inherited from class org.fcrepo.http.api.FedoraBaseResource
dbTransactionExecutor, identifierConverter, resourceFactory, resourceHelper, securityContext, servletRequest, txManager
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddResourceHttpHeaders(org.fcrepo.kernel.api.models.FedoraResource resource)Add any resource-specific headers to the responsejavax.ws.rs.core.ResponsecreateObject(org.glassfish.jersey.media.multipart.ContentDisposition contentDisposition, javax.ws.rs.core.MediaType requestContentType, String slug, InputStream requestBodyStream, List<String> rawLinks, String digest)Creates a new object.javax.ws.rs.core.ResponsecreateOrReplaceObjectRdf(javax.ws.rs.core.MediaType requestContentType, InputStream requestBodyStream, org.glassfish.jersey.media.multipart.ContentDisposition contentDisposition, String ifMatch, List<String> rawLinks, String digest)Create a resource at a specified path, or replace triples with provided RDF.javax.ws.rs.core.ResponsedeleteObject()Deletes an object.protected StringexternalPath()javax.ws.rs.core.ResponsegetResource(String rangeValue)Retrieve the node profilejavax.ws.rs.core.Responsehead()Retrieve the node headersjavax.ws.rs.core.Responseoptions()Outputs information about the supported HTTP methods, etc.javax.ws.rs.core.ResponseupdateSparql(InputStream requestBodyStream)Update an object using SPARQL-UPDATE-
Methods inherited from class org.fcrepo.http.api.ContentExposingResource
addCacheControlHeaders, addExternalContentHeaders, addLinkAndOptionsHttpHeaders, 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
-
externalPath
@PathParam("path") protected String externalPath
-
replaceBinariesService
@Inject protected org.fcrepo.kernel.api.services.ReplaceBinariesService replaceBinariesService
-
-
Method Detail
-
head
@HEAD @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 head() throws org.fcrepo.kernel.api.exception.UnsupportedAlgorithmExceptionRetrieve the node headers- Returns:
- response
- Throws:
org.fcrepo.kernel.api.exception.UnsupportedAlgorithmException- if unsupported digest algorithm occurred
-
options
@OPTIONS public javax.ws.rs.core.Response options()
Outputs information about the supported HTTP methods, etc.- Returns:
- the outputs information about the supported HTTP methods, etc.
-
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(@HeaderParam("Range") String rangeValue) throws IOException, org.fcrepo.kernel.api.exception.UnsupportedAlgorithmExceptionRetrieve the node profile- Parameters:
rangeValue- the range value- Returns:
- a binary or the triples for the specified node
- Throws:
IOException- if IO exception occurredorg.fcrepo.kernel.api.exception.UnsupportedAlgorithmException- if unsupported digest algorithm occurred
-
deleteObject
@DELETE public javax.ws.rs.core.Response deleteObject()
Deletes an object.- Returns:
- response
-
createOrReplaceObjectRdf
@PUT @Consumes public javax.ws.rs.core.Response createOrReplaceObjectRdf(@HeaderParam("Content-Type") javax.ws.rs.core.MediaType requestContentType, InputStream requestBodyStream, @HeaderParam("Content-Disposition") org.glassfish.jersey.media.multipart.ContentDisposition contentDisposition, @HeaderParam("If-Match") String ifMatch, @HeaderParam("Link") List<String> rawLinks, @HeaderParam("Digest") String digest) throws org.fcrepo.kernel.api.exception.InvalidChecksumException, org.fcrepo.kernel.api.exception.MalformedRdfException, org.fcrepo.kernel.api.exception.UnsupportedAlgorithmException, org.fcrepo.kernel.api.exception.PathNotFoundException
Create a resource at a specified path, or replace triples with provided RDF.- Parameters:
requestContentType- the request content typerequestBodyStream- the request body streamcontentDisposition- the content disposition valueifMatch- the if-match valuerawLinks- the raw link valuesdigest- the digest header- Returns:
- 204
- Throws:
org.fcrepo.kernel.api.exception.InvalidChecksumException- if invalid checksum exception occurredorg.fcrepo.kernel.api.exception.MalformedRdfException- if malformed rdf exception occurredorg.fcrepo.kernel.api.exception.UnsupportedAlgorithmException- if an unsupported algorithm exception occursorg.fcrepo.kernel.api.exception.PathNotFoundException
-
updateSparql
@Consumes("application/sparql-update") public javax.ws.rs.core.Response updateSparql(InputStream requestBodyStream) throws IOExceptionUpdate an object using SPARQL-UPDATE- Parameters:
requestBodyStream- the request body stream- Returns:
- 201
- Throws:
IOException- if IO exception occurred
-
createObject
@POST @Consumes({"application/octet-stream;qs=1.000","*/*"}) @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 createObject(@HeaderParam("Content-Disposition") org.glassfish.jersey.media.multipart.ContentDisposition contentDisposition, @HeaderParam("Content-Type") javax.ws.rs.core.MediaType requestContentType, @HeaderParam("Slug") String slug, InputStream requestBodyStream, @HeaderParam("Link") List<String> rawLinks, @HeaderParam("Digest") String digest) throws org.fcrepo.kernel.api.exception.InvalidChecksumException, org.fcrepo.kernel.api.exception.MalformedRdfException, org.fcrepo.kernel.api.exception.UnsupportedAlgorithmExceptionCreates a new object. This originally used application/octet-stream;qs=1001 as a workaround for JERSEY-2636, to ensure requests without a Content-Type get routed here. This qs value does not parse with newer versions of Jersey, as qs values must be between 0 and 1. We use qs=1.000 to mark where this historical anomaly had been.- Parameters:
contentDisposition- the content Disposition valuerequestContentType- the request content typeslug- the slug valuerequestBodyStream- the request body streamrawLinks- the link valuesdigest- the digest header- Returns:
- 201
- Throws:
org.fcrepo.kernel.api.exception.InvalidChecksumException- if invalid checksum exception occurredorg.fcrepo.kernel.api.exception.MalformedRdfException- if malformed rdf exception occurredorg.fcrepo.kernel.api.exception.UnsupportedAlgorithmException- if an unsupported algorithm exception occurs
-
addResourceHttpHeaders
protected void addResourceHttpHeaders(org.fcrepo.kernel.api.models.FedoraResource resource)
Description copied from class:ContentExposingResourceAdd any resource-specific headers to the response- Overrides:
addResourceHttpHeadersin classContentExposingResource- Parameters:
resource- the resource
-
externalPath
protected String externalPath()
- Specified by:
externalPathin classContentExposingResource
-
-