Class BsonFromCsvRequest

java.lang.Object
org.restheart.exchange.Exchange<org.bson.BsonArray>
org.restheart.exchange.Request<org.bson.BsonArray>
org.restheart.exchange.ServiceRequest<org.bson.BsonArray>
org.restheart.exchange.BsonFromCsvRequest

public class BsonFromCsvRequest extends ServiceRequest<org.bson.BsonArray>
ServiceRequest implementation backed by BsonValue and initialized from csv data. Two query parameters controls the conversion: 'id', the the index of the _id property and 'sep', the separator char
Author:
Andrea Di Cesare <andrea@softinstigate.com>
  • Field Details

  • Constructor Details

    • BsonFromCsvRequest

      protected BsonFromCsvRequest(io.undertow.server.HttpServerExchange exchange)
  • Method Details

    • init

      public static BsonFromCsvRequest init(io.undertow.server.HttpServerExchange exchange)
    • of

      public static BsonFromCsvRequest of(io.undertow.server.HttpServerExchange exchange)
    • parseContent

      public org.bson.BsonArray parseContent() throws IOException, BadRequestException
      Description copied from class: ServiceRequest
      Parses the content from the exchange and converts it into an instance of the specified type T. This method retrieves data from the exchange, interprets it according to the expected format, and attempts to convert this data into an object of type T.
      Specified by:
      parseContent in class ServiceRequest<org.bson.BsonArray>
      Returns:
      an instance of T representing the parsed content
      Throws:
      IOException - if an IO error occurs
      BadRequestException - if the content does not match the expected format for type T