Class Data
- java.lang.Object
-
- nzilbb.labbcat.server.api.APIRequestHandler
-
- nzilbb.labbcat.server.api.annotation.Data
-
public class Data extends APIRequestHandler
/api/annotation/data : Accesses binary data for annotations.Some layers have have their type set to a MIME type, e.g. "image/png". On those layers, each annotation is associated with binary data of the given MIME type, e.g. an PNG image. This endpoint provides access to that data.
The request method can be GET or POST
- Parameters:
id
- One or more annotations IDs.expression
- An expression to determine the annotations IDs. e.g. "['e_144_17346', 'e_144_17347'].includes(id)"name
- Optional name of the collection.show
- Optional parameter for suppressing disposition/filename headers, intended to allow easy display of the image in a browser, without the browser offering to download the file.
One of
id
orexpression
must be specified.Output: If one annotation ID is specified, the associated data file is returned. If multiple IDs are specified, a ZIP file is returned, which contains all the data files.
- Author:
- Robert Fromont
-
-
Field Summary
-
Fields inherited from class nzilbb.labbcat.server.api.APIRequestHandler
SC_BAD_REQUEST, SC_CONFLICT, SC_FORBIDDEN, SC_INTERNAL_SERVER_ERROR, SC_METHOD_NOT_ALLOWED, SC_NOT_FOUND, SC_OK, SC_UNPROCESSABLE_CONTENT, SC_UNSUPPORTED_MEDIA_TYPE
-
-
Constructor Summary
Constructors Constructor Description Data()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
post(RequestParameters parameters, OutputStream out, Consumer<String> contentType, Consumer<String> fileName, Consumer<Integer> httpStatus)
The GET or POST method for the servlet.-
Methods inherited from class nzilbb.labbcat.server.api.APIRequestHandler
GetSystemAttribute, init, writeResponse
-
-
-
-
Method Detail
-
post
public void post(RequestParameters parameters, OutputStream out, Consumer<String> contentType, Consumer<String> fileName, Consumer<Integer> httpStatus)
The GET or POST method for the servlet.- Parameters:
parameters
- Request parameter map.out
- Response body stream.contentType
- Receives the content type for specification in the response headers.fileName
- Receives the filename for specification in the response headers.httpStatus
- Receives the response status code, in case or error.
-
-