Once it's parsed successfully, set this URI. @see #getRawURI
()
| 2314 | * @see #getRawURI |
| 2315 | */ |
| 2316 | protected void setURI() { |
| 2317 | // set _uri |
| 2318 | StringBuilder buf = new StringBuilder(); |
| 2319 | // ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))? |
| 2320 | if (_scheme != null) { |
| 2321 | buf.append(_scheme); |
| 2322 | buf.append(':'); |
| 2323 | } |
| 2324 | if (_is_net_path) { |
| 2325 | buf.append("//"); |
| 2326 | if (_authority != null) { // has_authority |
| 2327 | buf.append(_authority); |
| 2328 | } |
| 2329 | } |
| 2330 | if (_opaque != null && _is_opaque_part) { |
| 2331 | buf.append(_opaque); |
| 2332 | } else if (_path != null) { |
| 2333 | // _is_hier_part or _is_relativeURI |
| 2334 | if (_path.length != 0) { |
| 2335 | buf.append(_path); |
| 2336 | } |
| 2337 | } |
| 2338 | if (_query != null) { // has_query |
| 2339 | buf.append('?'); |
| 2340 | buf.append(_query); |
| 2341 | } |
| 2342 | // ignore the fragment identifier |
| 2343 | _uri = buf.toString().toCharArray(); |
| 2344 | hash = 0; |
| 2345 | } |
| 2346 | |
| 2347 | // ----------------------------------------------------------- Test methods |
| 2348 |