MCPcopy Create free account
hub / github.com/davidgiven/luje / validateScheme

Method validateScheme

lib/java/net/URI.java:405–419  ·  view source on GitHub ↗
(String uri, String scheme, int index)

Source from the content-addressed store, hash-verified

403 }
404
405 private void validateScheme(String uri, String scheme, int index)
406 throws URISyntaxException {
407 // first char needs to be an alpha char
408 char ch = scheme.charAt(0);
409 if (!((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))) {
410 throw new URISyntaxException(uri, Messages.getString("luni.85"), 0); //$NON-NLS-1$
411 }
412
413 try {
414 URIEncoderDecoder.validateSimple(scheme, "+-."); //$NON-NLS-1$
415 } catch (URISyntaxException e) {
416 throw new URISyntaxException(uri, Messages.getString("luni.85"), index //$NON-NLS-1$
417 + e.getIndex());
418 }
419 }
420
421 private void validateSsp(String uri, String ssp, int index)
422 throws URISyntaxException {

Callers 1

parseURIMethod · 0.95

Calls 4

getStringMethod · 0.95
validateSimpleMethod · 0.95
getIndexMethod · 0.80
charAtMethod · 0.65

Tested by

no test coverage detected