Verifies the scheme contains only valid characters as per the URN specification (see NID). @see http://tools.ietf.org/html/rfc2141
(String scheme)
| 587 | * @see <a href="http://tools.ietf.org/html/rfc2141">http://tools.ietf.org/html/rfc2141</a> |
| 588 | */ |
| 589 | boolean isValidScheme(String scheme) { |
| 590 | for (int i = 0; i < scheme.length(); i++) { |
| 591 | char ch = scheme.charAt(i); |
| 592 | if (URIHelper.isAlpha(ch) || URIHelper.isNumeric(ch) || ch == '-') { |
| 593 | continue; |
| 594 | } |
| 595 | return false; |
| 596 | } |
| 597 | return true; |
| 598 | } |
| 599 | |
| 600 | /** |
| 601 | * Get the scheme part of the URI. |