Package org.duracloud.durastore.rest
Class ContentRest
java.lang.Object
org.duracloud.durastore.rest.BaseRest
org.duracloud.durastore.rest.ContentRest
@Path("/{spaceID: (?!acl/)[^/]+}/{contentID: [^?]+}")
@Component
public class ContentRest
extends BaseRest
Provides interaction with content via REST
- Author:
- Bill Branan
-
Field Summary
Fields inherited from class org.duracloud.durastore.rest.BaseRest
APP_NAME, APPLICATION_XML, CONTENT_MIMETYPE_HEADER, COPY_SOURCE_HEADER, COPY_SOURCE_STORE_HEADER, DEFAULT_MIME, HEADER_PREFIX, HTML, RANGE_HEADER, SPACE_ACL_HEADER, TEXT_PLAIN, XML -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected javax.ws.rs.core.ResponseaddContentPropertiesToResponse(javax.ws.rs.core.Response.ResponseBuilder response, Map<String, String> properties) Adds the properties of a content item as header values to the response.javax.ws.rs.core.ResponsedeleteContent(String spaceID, String contentID, String storeID) see ContentResource.removeContent()javax.ws.rs.core.ResponsegetContent(String spaceID, String contentID, String storeID, boolean attachment, String range) see ContentResource.getContent() see ContentResource.getContentProperties()javax.ws.rs.core.ResponsegetContentProperties(String spaceID, String contentID, String storeID) see ContentResource.getContentProperties()javax.ws.rs.core.ResponseputContent(String spaceID, String contentID, String storeID, String copySource, String sourceStoreID) see ContentResource.addContent() and ContentResource.copyContent().javax.ws.rs.core.ResponseupdateContentProperties(String spaceID, String contentID, String storeID) see ContentResource.updateContentProperties()protected booleanvalidMimetype(String mimetype) Methods inherited from class org.duracloud.durastore.rest.BaseRest
getAccountId, getSpaceACLs, getSubdomain, getUserProperties, getUserProperties, responseBad, responseBad, responseBad, responseBadRequest, responseNotFound, responseNotFound, responseOk, responseOk, responseOk, responseOkStream, responseOkXml, responseOkXmlStream
-
Constructor Details
-
ContentRest
-
-
Method Details
-
getContent
@GET public javax.ws.rs.core.Response getContent(@PathParam("spaceID") String spaceID, @PathParam("contentID") String contentID, @QueryParam("storeID") String storeID, @QueryParam("attachment") boolean attachment, @HeaderParam("Range") String range) see ContentResource.getContent() see ContentResource.getContentProperties()- Returns:
- 200 response with content stream as body and content properties as headers
-
getContentProperties
@HEAD public javax.ws.rs.core.Response getContentProperties(@PathParam("spaceID") String spaceID, @PathParam("contentID") String contentID, @QueryParam("storeID") String storeID) see ContentResource.getContentProperties()- Returns:
- 200 response with content properties as headers
-
addContentPropertiesToResponse
protected javax.ws.rs.core.Response addContentPropertiesToResponse(javax.ws.rs.core.Response.ResponseBuilder response, Map<String, String> properties) Adds the properties of a content item as header values to the response. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1 for specifics on particular headers. -
validMimetype
-
updateContentProperties
@POST public javax.ws.rs.core.Response updateContentProperties(@PathParam("spaceID") String spaceID, @PathParam("contentID") String contentID, @QueryParam("storeID") String storeID) see ContentResource.updateContentProperties()- Returns:
- 200 response indicating content properties updated successfully
-
putContent
@PUT public javax.ws.rs.core.Response putContent(@PathParam("spaceID") String spaceID, @PathParam("contentID") String contentID, @QueryParam("storeID") String storeID, @HeaderParam("x-dura-meta-copy-source") String copySource, @HeaderParam("x-dura-meta-copy-source-store") String sourceStoreID) see ContentResource.addContent() and ContentResource.copyContent().- Returns:
- 201 response indicating content added/copied successfully
-
deleteContent
@DELETE public javax.ws.rs.core.Response deleteContent(@PathParam("spaceID") String spaceID, @PathParam("contentID") String contentID, @QueryParam("storeID") String storeID) see ContentResource.removeContent()- Returns:
- 200 response indicating content removed successfully
-