Parses a single TSMeta object @throws JSONException if parsing failed @throws BadRequestException if the content was missing or parsing failed
()
| 325 | * @throws BadRequestException if the content was missing or parsing failed |
| 326 | */ |
| 327 | public TSMeta parseTSMetaV1() { |
| 328 | final String json = query.getContent(); |
| 329 | if (json == null || json.isEmpty()) { |
| 330 | throw new BadRequestException(HttpResponseStatus.BAD_REQUEST, |
| 331 | "Missing message content", |
| 332 | "Supply valid JSON formatted data in the body of your request"); |
| 333 | } |
| 334 | try { |
| 335 | return JSON.parseToObject(json, TSMeta.class); |
| 336 | } catch (IllegalArgumentException iae) { |
| 337 | throw new BadRequestException("Unable to parse the given JSON", iae); |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | /** |
| 342 | * Parses a single Tree object |
nothing calls this directly
no test coverage detected