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

Method validateSimple

lib/java/net/URIEncoderDecoder.java:82–92  ·  view source on GitHub ↗
(String s, String legal)

Source from the content-addressed store, hash-verified

80 }
81
82 static void validateSimple(String s, String legal)
83 throws URISyntaxException {
84 for (int i = 0; i < s.length();) {
85 char ch = s.charAt(i);
86 if (!((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')
87 || (ch >= '0' && ch <= '9') || legal.indexOf(ch) > -1)) {
88 throw new URISyntaxException(s, Messages.getString("luni.7F"), i); //$NON-NLS-1$
89 }
90 i++;
91 }
92 }
93
94 /**
95 * All characters except letters ('a'..'z', 'A'..'Z') and numbers ('0'..'9')

Callers 2

validateSchemeMethod · 0.95
isValidDomainNameMethod · 0.95

Calls 4

getStringMethod · 0.95
lengthMethod · 0.65
charAtMethod · 0.65
indexOfMethod · 0.65

Tested by

no test coverage detected