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 String
externalPath
protected ReplaceBinariesService
replaceBinariesService
-
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
-
Fields inherited from class org.fcrepo.http.commons.AbstractResource
defaultPidMinter, fedoraPropsConfig, headers, pidMinter, uriInfo, versionService
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addResourceHttpHeaders(FedoraResource resource)
protected void
addResourceHttpHeaders(FedoraResource resource, boolean dispositionInline)
Add any resource-specific headers to the responsejavax.ws.rs.core.Response
createObject(String contentDispositionRaw, javax.ws.rs.core.MediaType requestContentType, String slug, InputStream requestBodyStream, List<String> rawLinks, String digest)
Creates a new object.javax.ws.rs.core.Response
createOrReplaceObjectRdf(javax.ws.rs.core.MediaType requestContentType, InputStream requestBodyStream, String contentDispositionRaw, String ifMatch, List<String> rawLinks, String digest)
Create a resource at a specified path, or replace triples with provided RDF.javax.ws.rs.core.Response
deleteObject()
Deletes an object.protected String
externalPath()
javax.ws.rs.core.Response
getResource(String rangeValue, boolean inlineDisposition)
Retrieve the node profilejavax.ws.rs.core.Response
head(boolean inlineDisposition)
Retrieve the node headersjavax.ws.rs.core.Response
options()
Outputs information about the supported HTTP methods, etc.javax.ws.rs.core.Response
updateSparql(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 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","text/html;charset=utf-8","*/*"}) public javax.ws.rs.core.Response head(@DefaultValue("false") @QueryParam("inline") boolean inlineDisposition) throws UnsupportedAlgorithmException
Retrieve the node headers- Parameters:
inlineDisposition
- whether to return a Content-Disposition inline header for a binary- Returns:
- response
- Throws:
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","text/html;charset=utf-8","*/*"}) public javax.ws.rs.core.Response getResource(@HeaderParam("Range") String rangeValue, @DefaultValue("false") @QueryParam("inline") boolean inlineDisposition) throws IOException, UnsupportedAlgorithmException
Retrieve the node profile- Parameters:
rangeValue
- the range valueinlineDisposition
- whether to return a Content-Disposition inline header for a binary- Returns:
- a binary or the triples for the specified node
- Throws:
IOException
- if IO exception occurredUnsupportedAlgorithmException
- 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") String contentDispositionRaw, @HeaderParam("If-Match") String ifMatch, @HeaderParam("Link") List<String> rawLinks, @HeaderParam("Digest") String digest) throws InvalidChecksumException, MalformedRdfException, UnsupportedAlgorithmException, PathNotFoundException
Create a resource at a specified path, or replace triples with provided RDF.- Parameters:
requestContentType
- the request content typerequestBodyStream
- the request body streamcontentDispositionRaw
- the content disposition valueifMatch
- the if-match valuerawLinks
- the raw link valuesdigest
- the digest header- Returns:
- 204
- Throws:
InvalidChecksumException
- if invalid checksum exception occurredMalformedRdfException
- if malformed rdf exception occurredUnsupportedAlgorithmException
- if an unsupported algorithm exception occursPathNotFoundException
-
updateSparql
@Consumes("application/sparql-update") public javax.ws.rs.core.Response updateSparql(InputStream requestBodyStream) throws IOException
Update 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","text/html;charset=utf-8","*/*"}) public javax.ws.rs.core.Response createObject(@HeaderParam("Content-Disposition") String contentDispositionRaw, @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 InvalidChecksumException, MalformedRdfException, UnsupportedAlgorithmException
Creates 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:
contentDispositionRaw
- the content Disposition valuerequestContentType
- the request content typeslug
- the slug valuerequestBodyStream
- the request body streamrawLinks
- the link valuesdigest
- the digest header- Returns:
- 201
- Throws:
InvalidChecksumException
- if invalid checksum exception occurredMalformedRdfException
- if malformed rdf exception occurredUnsupportedAlgorithmException
- if an unsupported algorithm exception occurs
-
addResourceHttpHeaders
protected void addResourceHttpHeaders(FedoraResource resource)
- Overrides:
addResourceHttpHeaders
in classContentExposingResource
-
addResourceHttpHeaders
protected void addResourceHttpHeaders(FedoraResource resource, boolean dispositionInline)
Description copied from class:ContentExposingResource
Add any resource-specific headers to the response- Overrides:
addResourceHttpHeaders
in classContentExposingResource
- Parameters:
resource
- the resourcedispositionInline
- whether to return a binary as Content-Disposition inline
-
externalPath
protected String externalPath()
- Specified by:
externalPath
in classContentExposingResource
-
-