Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
datastream docs
  • Loading branch information
cbeer committed Feb 4, 2013
1 parent f33ba64 commit 7cae6cf
Showing 1 changed file with 80 additions and 1 deletion.
81 changes: 80 additions & 1 deletion src/main/java/org/fcrepo/modeshape/FedoraDatastreams.java
Expand Up @@ -36,6 +36,15 @@ public class FedoraDatastreams extends AbstractResource {
final private Logger logger = LoggerFactory
.getLogger(FedoraDatastreams.class);

/**
* Returns a list of datastreams for the object
*
* @param pid persistent identifier of the digital object
* @return the list of datastreams
* @throws RepositoryException
* @throws IOException
* @throws TemplateException
*/
@SuppressWarnings("unchecked")
@GET
@Path("/")
Expand All @@ -62,6 +71,17 @@ public Response getDatastreams(@PathParam("pid") final String pid)
}
}

/**
* Create a new datastream
*
* @param pid persistent identifier of the digital object
* @param dsid datastream identifier
* @param contentType Content-Type header
* @param requestBodyStream Binary blob
* @return 201 Created
* @throws RepositoryException
* @throws IOException
*/
@POST
@Path("/{dsid}")
public Response addDatastream(@PathParam("pid") final String pid,
Expand Down Expand Up @@ -107,6 +127,17 @@ public Response addDatastream(@PathParam("pid") final String pid,
}
}

/**
* Modify an existing datastream's content
*
* @param pid persistent identifier of the digital object
* @param dsid datastream identifier
* @param contentType Content-Type header
* @param requestBodyStream Binary blob
* @return 201 Created
* @throws RepositoryException
* @throws IOException
*/
@PUT
@Path("/{dsid}")
public Response modifyDatastream(@PathParam("pid") final String pid,
Expand Down Expand Up @@ -188,6 +219,16 @@ private Node addDatastreamNode(final String dspath,
return ds;
}

/**
* Get the datastream profile of a datastream
*
* @param pid persistent identifier of the digital object
* @param dsid datastream identifier
* @return 200
* @throws RepositoryException
* @throws IOException
* @throws TemplateException
*/
@GET
@Path("/{dsid}")
@Produces("text/xml")
Expand Down Expand Up @@ -224,6 +265,14 @@ public Response getDatastream(@PathParam("pid") final String pid,
}
}

/**
* Get the binary content of a datastream
*
* @param pid persistent identifier of the digital object
* @param dsid datastream identifier
* @return Binary blob
* @throws RepositoryException
*/
@GET
@Path("/{dsid}/content")
public Response getDatastreamContent(@PathParam("pid") final String pid,
Expand All @@ -248,6 +297,16 @@ public Response getDatastreamContent(@PathParam("pid") final String pid,
}
}

/**
* Get previous version information for this datastream
*
* @param pid persistent identifier of the digital object
* @param dsid datastream identifier
* @return 200
* @throws RepositoryException
* @throws IOException
* @throws TemplateException
*/
@GET
@Path("/{dsid}/versions")
@Produces("text/xml")
Expand All @@ -269,7 +328,19 @@ public Response getDatastreamHistory(@PathParam("pid") final String pid,
return four04;
}
}

/**
* Get previous version information for this datastream. See /{dsid}/versions. Kept for compatibility
* with fcrepo <3.5 API.
*
* @deprecated
*
* @param pid persistent identifier of the digital object
* @param dsid datastream identifier
* @return 200
* @throws RepositoryException
* @throws IOException
* @throws TemplateException
*/
@GET
@Path("/{dsid}/history")
@Produces("text/xml")
Expand All @@ -279,6 +350,14 @@ public Response getDatastreamHistoryOld(@PathParam("pid") final String pid,
return getDatastreamHistory(pid, dsid);
}

/**
* Purge the datastream
*
* @param pid persistent identifier of the digital object
* @param dsid datastream identifier
* @return 204
* @throws RepositoryException
*/
@DELETE
@Path("/{dsid}")
public Response deleteDatastream(@PathParam("pid") String pid,
Expand Down

0 comments on commit 7cae6cf

Please sign in to comment.