(String ssp, boolean encode)
| 442 | /// |
| 443 | /// - `URISyntaxException`: if the ssp is invalid. |
| 444 | protected void parseSchemeSpecificPart(String ssp, boolean encode) throws URISyntaxException { |
| 445 | if (ssp == null) { |
| 446 | throw new URISyntaxException(ssp, "Invalid scheme specific part"); |
| 447 | } |
| 448 | if (scheme != null && ssp.charAt(0) != PATH_SEPARATOR) { |
| 449 | this.opaque = true; |
| 450 | this.schemeSpecificPart = ssp; |
| 451 | return; |
| 452 | } |
| 453 | int index; |
| 454 | String s = ssp; |
| 455 | |
| 456 | if ((index = s.lastIndexOf(QUERY_MARKER)) != -1) { |
| 457 | setQuery(s.substring(index + 1), encode); |
| 458 | s = s.substring(0, index); |
| 459 | } else if (getQuerySeparator() == SOCKET_QUERY_SEPARATOR && (index = s.indexOf(SOCKET_QUERY_SEPARATOR)) != -1) { |
| 460 | setQuery(s.substring(index + 1).replace(SOCKET_QUERY_SEPARATOR, QUERY_SEPARATOR), encode); |
| 461 | s = s.substring(0, index); |
| 462 | } |
| 463 | |
| 464 | index = (s.startsWith(AUTHORITY_MARKER)) ? 2 : 0; |
| 465 | index = s.indexOf(PATH_SEPARATOR, index); |
| 466 | if (index != -1) { |
| 467 | setPath(s.substring(index), encode); |
| 468 | s = s.substring(0, index); |
| 469 | } |
| 470 | setAuthority(s, encode); |
| 471 | } |
| 472 | |
| 473 | /// Internal utility method to throw a syntax error if a value can not be |
| 474 | /// parsed. |
no test coverage detected