Utility method to construct the scheme specific part from the uri segments (less scheme and fragment) @return
()
| 432 | * @return |
| 433 | */ |
| 434 | protected String rebuildSchemeSpecificPart() { |
| 435 | StringBuffer buffer = new StringBuffer(); |
| 436 | if (opaque == false && (host != null || port != -1)) { |
| 437 | buffer.append(AUTHORITY_MARKER); |
| 438 | if (userInfo != null) { |
| 439 | buffer.append(getRawUserInfo() + USERINFO_SEPARATOR); |
| 440 | } |
| 441 | if (host != null) { |
| 442 | buffer.append(getHost()); |
| 443 | } |
| 444 | if (port != -1) { |
| 445 | buffer.append(PORT_SEPARATOR); |
| 446 | buffer.append(getPort()); |
| 447 | } |
| 448 | } |
| 449 | if (path != null) { |
| 450 | buffer.append(getRawPath()); |
| 451 | } |
| 452 | if (query != null) { |
| 453 | if (querySeparator == SOCKET_QUERY_SEPARATOR) { |
| 454 | buffer.append(querySeparator + getRawQuery().replace(QUERY_SEPARATOR, SOCKET_QUERY_SEPARATOR)); |
| 455 | } else { |
| 456 | buffer.append(QUERY_MARKER + getRawQuery()); |
| 457 | } |
| 458 | } |
| 459 | return buffer.toString(); |
| 460 | } |
| 461 | |
| 462 | /** |
| 463 | * A convenience factory method, intended to be used when the URI string is |
no test coverage detected