Parses query string parameters into a blank tree object. Used for updating tree meta data. @param query The HTTP query to work with @return A tree object filled in with changes @throws BadRequestException if some of the data was invalid
(HttpQuery query)
| 572 | * @throws BadRequestException if some of the data was invalid |
| 573 | */ |
| 574 | private Tree parseTree(HttpQuery query) { |
| 575 | final Tree tree = new Tree(parseTreeId(query, false)); |
| 576 | if (query.hasQueryStringParam("name")) { |
| 577 | tree.setName(query.getQueryStringParam("name")); |
| 578 | } |
| 579 | if (query.hasQueryStringParam("description")) { |
| 580 | tree.setDescription(query.getQueryStringParam("description")); |
| 581 | } |
| 582 | if (query.hasQueryStringParam("notes")) { |
| 583 | tree.setNotes(query.getQueryStringParam("notes")); |
| 584 | } |
| 585 | if (query.hasQueryStringParam("strict_match")) { |
| 586 | if (query.getQueryStringParam("strict_match").toLowerCase() |
| 587 | .equals("true")) { |
| 588 | tree.setStrictMatch(true); |
| 589 | } else { |
| 590 | tree.setStrictMatch(false); |
| 591 | } |
| 592 | } |
| 593 | if (query.hasQueryStringParam("enabled")) { |
| 594 | final String enabled = query.getQueryStringParam("enabled"); |
| 595 | if (enabled.toLowerCase().equals("true")) { |
| 596 | tree.setEnabled(true); |
| 597 | } else { |
| 598 | tree.setEnabled(false); |
| 599 | } |
| 600 | } |
| 601 | if (query.hasQueryStringParam("store_failures")) { |
| 602 | if (query.getQueryStringParam("store_failures").toLowerCase() |
| 603 | .equals("true")) { |
| 604 | tree.setStoreFailures(true); |
| 605 | } else { |
| 606 | tree.setStoreFailures(false); |
| 607 | } |
| 608 | } |
| 609 | return tree; |
| 610 | } |
| 611 | |
| 612 | /** |
| 613 | * Parses query string parameters into a blank tree rule object. Used for |
no test coverage detected