MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / parseSchemeSpecificPart

Method parseSchemeSpecificPart

Ports/CLDC11/src/java/net/URI.java:444–471  ·  view source on GitHub ↗
(String ssp, boolean encode)

Source from the content-addressed store, hash-verified

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.

Callers 2

setSchemeSpecificPartMethod · 0.95
parseURIMethod · 0.95

Calls 10

lastIndexOfMethod · 0.95
setQueryMethod · 0.95
substringMethod · 0.95
getQuerySeparatorMethod · 0.95
indexOfMethod · 0.95
startsWithMethod · 0.95
setPathMethod · 0.95
setAuthorityMethod · 0.95
charAtMethod · 0.65
replaceMethod · 0.65

Tested by

no test coverage detected