Package org.fcrepo.http.api
Class FedoraVersioning
- java.lang.Object
-
- org.fcrepo.http.commons.AbstractResource
-
- org.fcrepo.http.api.FedoraBaseResource
-
- org.fcrepo.http.api.ContentExposingResource
-
- org.fcrepo.http.api.FedoraVersioning
-
@Scope("request") @Path("/{path: .*}/fcr:versions") public class FedoraVersioning extends ContentExposingResource
- Since:
- 9/25/14
- Author:
- cabeer
-
-
Field Summary
Fields Modifier and Type Field Description protected String
externalPath
static String
MEMENTO_DATETIME_HEADER
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 FedoraVersioning()
Default JAX-RS entry pointFedoraVersioning(String externalPath)
Create a new FedoraNodes instance for a given path
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.Response
addVersion()
Create a new version of a resource.javax.ws.rs.core.Response
delete()
Can't delete TimeMapsprotected String
externalPath()
javax.ws.rs.core.Response
getVersionList(String acceptValue)
Get the list of versions for the objectjavax.ws.rs.core.Response
options()
Outputs information about the supported HTTP methods, etc.-
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
-
MEMENTO_DATETIME_HEADER
public static final String MEMENTO_DATETIME_HEADER
- See Also:
- Constant Field Values
-
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
-
FedoraVersioning
public FedoraVersioning()
Default JAX-RS entry point
-
FedoraVersioning
public FedoraVersioning(String externalPath)
Create a new FedoraNodes instance for a given path- Parameters:
externalPath
- the external path
-
-
Method Detail
-
addVersion
@POST public javax.ws.rs.core.Response addVersion()
Create a new version of a resource. If a memento-datetime header is provided, then the new version will be based off the provided body using that datetime. If one was not provided, then a version is created based off the current version of the resource.- Returns:
- response
- Throws:
InvalidChecksumException
- thrown if one of the provided digests does not match the contentMementoDatetimeFormatException
- if the header value of memento-datetime is not RFC-1123 format
-
getVersionList
@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","application/link-format"}) public javax.ws.rs.core.Response getVersionList(@HeaderParam("Accept") String acceptValue) throws IOException
Get the list of versions for the object- Parameters:
acceptValue
- the rdf media-type- Returns:
- List of versions for the object as RDF
- Throws:
IOException
- in case of error extracting content
-
options
@OPTIONS public javax.ws.rs.core.Response options()
Outputs information about the supported HTTP methods, etc.- Returns:
- the information about the supported HTTP methods, etc.
-
delete
@DELETE @Produces("text/plain;charset=utf-8") public javax.ws.rs.core.Response delete()
Can't delete TimeMaps- Returns:
- the response to a delete request.
-
externalPath
protected String externalPath()
- Specified by:
externalPath
in classContentExposingResource
-
-