Class 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 a threadId 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
    • Constructor Detail

      • Upload

        public Upload()
        Default constructor.
    • 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