Class Upload
- java.lang.Object
-
- nzilbb.labbcat.server.api.APIRequestHandler
-
- nzilbb.labbcat.server.api.results.Upload
-
public class Upload extends APIRequestHandler
/api/results/upload : Handler for receiving a CSV results file previously returned by /api/results.POST method receives the data file and begins the process of parsing the results.
The multipart-encoded parameters are:
- results
- Results file to upload.
- csvFieldDelimiter
- Optional character for delimiting the CSV field. If not specified, the delimiter will be inferred from the first line of the file.
- targetColumn
- Optional column name that identifies each match. The default is
MatchId
Output: a JSON-encoded response object of the usual structure for which the
model
is an object with athreadId
attribute, which is the ID of the server task to monitor file parsing progress. e.g.{ "title":"upload", "version" : "20250711.1119", "code" : 0, "errors" : [], "messages" : [], "model" : { "threadId" : "80" } }
The task, when finished, will output a URL for accessing the matches of the search.
- Author:
- Robert Fromont robert@fromont.net.nz
-
-
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 Upload()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.json.JsonObject
post(RequestParameters requestParameters, Consumer<Integer> httpStatus)
The POST method for the servlet.-
Methods inherited from class nzilbb.labbcat.server.api.APIRequestHandler
GetSystemAttribute, init, writeResponse
-
-
-
-
Method Detail
-
post
public javax.json.JsonObject post(RequestParameters requestParameters, Consumer<Integer> httpStatus)
The POST method for the servlet.- Parameters:
requestParameters
- Request parameter map.httpStatus
- Receives the response status code, in case of error.- Returns:
- JSON-encoded object representing the response
-
-