javax.ws.rs.container.ContainerRequestFilter, javax.ws.rs.container.ContainerResponseFilter@PreMatching
@Provider
@Priority(2010)
@Singleton
@Path("upload/{partition}/{id}")
public class MultipartUploader
extends java.lang.Object
implements javax.ws.rs.container.ContainerRequestFilter, javax.ws.rs.container.ContainerResponseFilter
| Constructor | Description |
|---|---|
MultipartUploader(org.trellisldp.api.ResourceService resourceService,
org.trellisldp.api.BinaryService binaryService,
java.util.Map<java.lang.String,java.lang.String> partitions) |
Create a multipart uploader object
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
abortUpload(java.lang.String partition,
java.lang.String id) |
Abort an upload process
|
javax.ws.rs.core.Response |
createBinary(java.lang.String partition,
java.lang.String id,
java.io.InputStream input) |
Create a binary from a collection of uploaded parts
|
void |
filter(javax.ws.rs.container.ContainerRequestContext ctx) |
|
void |
filter(javax.ws.rs.container.ContainerRequestContext req,
javax.ws.rs.container.ContainerResponseContext res) |
|
java.lang.String |
listUploads(java.lang.String partition,
java.lang.String id) |
Get a list of the uploads
|
java.lang.String |
uploadPart(java.lang.String partition,
java.lang.String id,
java.lang.Integer partNumber,
java.io.InputStream part) |
Add a segment of a binary
|
public MultipartUploader(org.trellisldp.api.ResourceService resourceService,
org.trellisldp.api.BinaryService binaryService,
java.util.Map<java.lang.String,java.lang.String> partitions)
resourceService - the resource servicebinaryService - the binary servicepartitions - the partition base URLspublic void filter(javax.ws.rs.container.ContainerRequestContext ctx)
throws java.io.IOException
filter in interface javax.ws.rs.container.ContainerRequestFilterjava.io.IOExceptionpublic void filter(javax.ws.rs.container.ContainerRequestContext req,
javax.ws.rs.container.ContainerResponseContext res)
throws java.io.IOException
filter in interface javax.ws.rs.container.ContainerResponseFilterjava.io.IOException@GET
@Timed
@Produces("application/json")
public java.lang.String listUploads(@PathParam("partition")
java.lang.String partition,
@PathParam("id")
java.lang.String id)
partition - the partitionid - the upload idNote: the response structure will be like this:
{
"1": "somehash",
"2": "otherhash",
"3": "anotherhash"
}@POST
@Timed
@Consumes("application/json")
public javax.ws.rs.core.Response createBinary(@PathParam("partition")
java.lang.String partition,
@PathParam("id")
java.lang.String id,
java.io.InputStream input)
partition - the partitionid - the identifierinput - the input valueNote: The structure should be like this:
{
"1": "somehash",
"2": "otherhash",
"3": "anotherhash"
}@PUT
@Timed
@Path("{partNumber}")
@Produces("application/json")
public java.lang.String uploadPart(@PathParam("partition")
java.lang.String partition,
@PathParam("id")
java.lang.String id,
@PathParam("partNumber")
java.lang.Integer partNumber,
java.io.InputStream part)
partition - the partitionid - the upload session identifierpartNumber - the part numberpart - the input streamNote: the response will be a json structure, such as:
{
"digest": "a-hash"
}@DELETE
@Timed
public void abortUpload(@PathParam("partition")
java.lang.String partition,
@PathParam("id")
java.lang.String id)
partition - the partitionid - the upload identifier