Utility method to set the query. If parameter encode=true, then the result will be encoded, otherwise the result will be validated to ensure encoding is valid. Typically the multi-parameter constructors will call this method with encode=true, and the single parameter construct will pass encode=false
(String query, boolean encode)
| 342 | * @throws URISyntaxException |
| 343 | */ |
| 344 | protected void setQuery(String query, boolean encode) throws URISyntaxException { |
| 345 | if ((this.query = query) != null) { |
| 346 | if (encode) { |
| 347 | this.query = URIHelper.encodeString(this.query); |
| 348 | } else { |
| 349 | // validate |
| 350 | URIHelper.decodeString(this.query); |
| 351 | } |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | /** |
| 356 | * Utility method to set the path. If parameter encode=true, then the result |
no test coverage detected